Doesn't reply to replies, because that would get messy and I don't want

the bot giving me another pattern when I reply to one of its posts
This commit is contained in:
Mike Lynch 2025-08-25 16:51:21 +10:00
parent be0844c0eb
commit 5fdef65846

View File

@ -207,11 +207,15 @@ async function send_replies(argv, cf) {
created: s.created_at, created: s.created_at,
status_id: status.id, status_id: status.id,
account: account.acct, account: account.acct,
url: status.url url: status.url,
in_reply_to_id: status.in_reply_to_id
}; };
}); });
const newmentions = mentions.filter((m) => !oldids.includes(m.id)); const newmentions = mentions.filter((m) => !oldids.includes(m.id));
for (const mention of newmentions) { for (const mention of newmentions) {
if( mention.in_reply_to_id ) {
console.log(`won't reply to ${mention.id} as it's a reply to ${mention.in_reply_to_id}`);
} else {
console.log(`new mention ${mention.id}`); console.log(`new mention ${mention.id}`);
const reply = { const reply = {
id: mention.status_id, id: mention.status_id,
@ -220,6 +224,7 @@ async function send_replies(argv, cf) {
post(argv, cf, reply); post(argv, cf, reply);
} }
}
if( !argv.n ) { if( !argv.n ) {
await promises.writeFile(cf.mentions, JSON.stringify(mentions, null, 4)); await promises.writeFile(cf.mentions, JSON.stringify(mentions, null, 4));
} }