瀏覽代碼

fix duplicate subscription by post url

Mike L 3 年之前
父節點
當前提交
ed61efcc9d
共有 2 個文件被更改,包括 2 次插入2 次删除
  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);
     });