Compare commits

...

4 Commits

Author SHA1 Message Date
Mike Lynch
0df4ab0bcc Respects visibility of post it's replying to 2025-08-25 17:21:23 +10:00
Mike Lynch
5fdef65846 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
2025-08-25 16:51:21 +10:00
Mike Lynch
be0844c0eb Updated version 2025-08-25 16:16:20 +10:00
Mike Lynch
3dec0cf6b8 Updated changelog 2025-08-25 16:15:08 +10:00
3 changed files with 31 additions and 10 deletions

View File

@ -1,5 +1,17 @@
# CHANGELOG.md
## v1.2.3
Gave the bot the ability to reply with a customised pattern
## v1.2.1
Minor refactoring
## v1.2.0
I think this was when I added the gotosocial bot
## v1.1.1
Made the flashing transitions a bit better, but it still needs more work

View File

@ -207,19 +207,27 @@ async function send_replies(argv, cf) {
created: s.created_at,
status_id: status.id,
account: account.acct,
url: status.url
url: status.url,
in_reply_to_id: status.in_reply_to_id,
visibility: status.visibility
};
});
const newmentions = mentions.filter((m) => !oldids.includes(m.id));
for (const mention of newmentions) {
console.log(JSON.stringify(mention, null, 2));
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}`);
const reply = {
id: mention.status_id,
account: `@${mention.account}`
account: `@${mention.account}`,
visibility: mention.visibility,
};
post(argv, cf, reply);
}
}
if( !argv.n ) {
await promises.writeFile(cf.mentions, JSON.stringify(mentions, null, 4));
}
@ -249,6 +257,7 @@ async function post_image(image, alt_text, cf, reply) {
if( reply ) {
status_body["in_reply_to_id"] = reply.id;
status_body["status"] = reply.account;
status_body["visibility"] = reply.visibility;
}
headers['Accept'] = 'application/json';
headers['Content-Type'] = 'application/json';

View File

@ -8,7 +8,7 @@ toc: false
colourful generative patterns using [d3](https://d3js.org/) and [Observable Framework](https://observablehq.com/framework/)
<p>v1.2.2 | by <a href="https://mikelynch.org">mike lynch</a> | <a href="https://aus.social/@mikelynch">@mikelynch@aus.social</a> | <a href="https://git.tilde.town/bombinans/poptimal">source</a> | <a href="https://mikelynch.org/2025/Mar/09/poptimal/">about</a></p>
<p>v1.2.3 | by <a href="https://mikelynch.org">mike lynch</a> | <a href="https://aus.social/@mikelynch">@mikelynch@aus.social</a> | <a href="https://git.tilde.town/bombinans/poptimal">source</a> | <a href="https://mikelynch.org/2025/Mar/09/poptimal/">about</a></p>
<div class="grid grid-cols-3">