Skip to content

Commit

Permalink
Added liking before commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliasyoussef47 committed Aug 26, 2020
1 parent b421724 commit c5f09dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ let iac = new InstaAutoComment();
console.log('\n');
// you received a notification
iac.ig.fbns.push$.subscribe(
(push) => {
async (push) => {
if (push.pushCategory === "post" && trackedUsersPks.includes(Number(push.sourceUserId))) {
iac.commentOnPostWithRandomComment(push.actionParams["id"], commentsArray);
await iac.ig.media.like({d: 1, mediaId: push.actionParams["id"], moduleInfo: {module_name: 'feed_timeline'}})
await iac.commentOnPostWithRandomComment(push.actionParams["id"], commentsArray);
}
}
);
Expand Down Expand Up @@ -84,6 +85,7 @@ let iac = new InstaAutoComment();
const spinner = ora('Waiting for a notification').start();
});
} catch (e) {
console.log(e);
if (pushbulletAccessToken) pusher.note('', 'InstaAutoComment | Error with program', e.message);
}
})();
Expand Down

0 comments on commit c5f09dd

Please sign in to comment.