Skip to content

Commit c5f09dd

Browse files
Added liking before commenting
1 parent b421724 commit c5f09dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ let iac = new InstaAutoComment();
4646
console.log('\n');
4747
// you received a notification
4848
iac.ig.fbns.push$.subscribe(
49-
(push) => {
49+
async (push) => {
5050
if (push.pushCategory === "post" && trackedUsersPks.includes(Number(push.sourceUserId))) {
51-
iac.commentOnPostWithRandomComment(push.actionParams["id"], commentsArray);
51+
await iac.ig.media.like({d: 1, mediaId: push.actionParams["id"], moduleInfo: {module_name: 'feed_timeline'}})
52+
await iac.commentOnPostWithRandomComment(push.actionParams["id"], commentsArray);
5253
}
5354
}
5455
);
@@ -84,6 +85,7 @@ let iac = new InstaAutoComment();
8485
const spinner = ora('Waiting for a notification').start();
8586
});
8687
} catch (e) {
88+
console.log(e);
8789
if (pushbulletAccessToken) pusher.note('', 'InstaAutoComment | Error with program', e.message);
8890
}
8991
})();

0 commit comments

Comments
 (0)