Explorar o código

fix duplicate subscription by post url

Mike L %!s(int64=3) %!d(string=hai) anos
pai
achega
ed61efcc9d
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      dist/command.js
  2. 1 1
      src/command.ts

+ 1 - 1
dist/command.js

@@ -92,7 +92,7 @@ https://www.instagram.com/p/B6GHRSmgV-7/`);
         twitter_1.getPostOwner(matched.postUrlSegment).then(userName => {
             delete matched.postUrlSegment;
             matched.userName = userName.split(':')[0];
-            if (!tryFindSub(userName))
+            if (!tryFindSub(matched.userName))
                 newSub(userName);
         }).catch((parsedErr) => {
             reply(parsedErr.message);

+ 1 - 1
src/command.ts

@@ -101,7 +101,7 @@ https://www.instagram.com/p/B6GHRSmgV-7/`);
     getPostOwner(matched.postUrlSegment).then(userName => {
       delete matched.postUrlSegment;
       matched.userName = userName.split(':')[0];
-      if (!tryFindSub(userName)) newSub(userName);
+      if (!tryFindSub(matched.userName)) newSub(userName);
     }).catch((parsedErr: Error) => {
       reply(parsedErr.message);
     });