You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I've been making a simple bot with @atproto/api - the bot awaits for interactions and generates a reply and sends it.
The bot runs from a cron task every hour (currently), but each time the cron task runs, it creates a new message to the same post it found previously, creating new reply (to the same thread) every hour, until (I think) I manually view the post via the Bluesky app which then makes the post as read.
Example code:
constnotificationsResponse=awaitagent.listNotifications();constnotificationsData=notificationsResponse.data;const{ notifications }=notificationsData;for(const{ cid, uri, isRead, reason }ofnotifications){if(!["reply","mention"].includes(reason))returnif(isRead)return;// --> how do I set `isRead` to true? Seems it's always false every cron tickawaitagent.like(uri,cid);awaitagent.post({text: getDarkSoulsWisdom(),reply: {root: { cid, uri },parent: { cid, uri }},})awaitagent.updateSeenNotifications();// --> would this be a way to mark the notification as read? The args say `seenAt: string` - where would I get that value? How would it apply to the current notification?}
Describe the solution you'd like
A way of setting a notification as viewed/read/seen so isRead is true, and the bot does not reply to the same notification multiple times
Describe alternatives you've considered
My bot runs in a serverless environment, so storing local files won't work as they're ephemeral. Setting up a database for this seems overkill, perhaps.
Additional context
I'm almost certainly missing something from docs somewhere - but I'm not able to find what I'm looking for.
The text was updated successfully, but these errors were encountered:
Update!
I've just spotted that const notificationsResponse = await agent.listNotifications();
returns a notifications and seenAt value... (listNotifications)
I'll try using the seenAt value like this (after I've replied to the notifications): await agent.updateSeenNotifications(seenAt);
Is your feature request related to a problem? Please describe.
I've been making a simple bot with @atproto/api - the bot awaits for interactions and generates a reply and sends it.
The bot runs from a
cron
task every hour (currently), but each time the cron task runs, it creates a new message to the same post it found previously, creating new reply (to the same thread) every hour, until (I think) I manually view the post via the Bluesky app which then makes the post as read.Example code:
Describe the solution you'd like
A way of setting a
notification
as viewed/read/seen soisRead
is true, and the bot does not reply to the same notification multiple timesDescribe alternatives you've considered
My bot runs in a serverless environment, so storing local files won't work as they're ephemeral. Setting up a database for this seems overkill, perhaps.
Additional context
I'm almost certainly missing something from docs somewhere - but I'm not able to find what I'm looking for.
The text was updated successfully, but these errors were encountered: