Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted my bot to be able to intercept all replies made below its own posts, regardless of their parent-post.
This PR adds the ability to listen to those kind of replies, without interfering with the
reply
event, and without duplicate issues sincereply
takes precedence.Possible problems: it will take precedence over
quote
&mention
if someone happens to quote/mention the bot account in a reply inside a thread initiated by the bot. Note: The same behavior was already happening with thereply
event.I implemented the event into the polling interceptor as well. I took care to still ignore non-direct replies which are made to threads not initiated by the bot: it can happen when the bot has participated inside a thread and someone replies to a replying post.
Other minor fixes: I replaced
includes
withstartsWith
(it's more appropriate to what it's supposed to do, and it's way more efficient; we're inside a Jetstream event handler so it does matter). I also added a/
after the did, because, apart from PLC DIDs, they do not have a fixed length.I am opened to any suggestion, including about the event name, I didn't find any naming convention. I could have used a hyphen instead of an underscore. Please suggest away if you happen to think of a better event name. Btw, edits by maintainers are allowed.