-
-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle adding reactions to messages from users who have blocked the bot #2580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scheduling is something that is handled by bot-core, so the fix would need to be there. The error handler should probably be ported there first, so we don't have to duplicate this in multiple places. It might make sense to have central error handling that errors from everywhere are handled by, but i've not looked into it so i'm not too sure.
…nfo in log statement
So are you suggesting to merge this PR as-is, and add the schedule handling to bot-core at a later time? I'd be okay with this, as long as the exceptions raised aren't going to cause sentry alerts etc. |
For the record, @ChrisLovering and I have come up with a solution for handling errors in the schedules (see python-discord/bot-core#177). |
I don't understand how the bot-core PR would help. Would we have to change all uses of create_task to add an error handler? That doesn't seem great, compared to just handling it there directly. |
Yeah, you're right, in reality we'd want the In fact, this change would make the |
This PR is now ready for review! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and seems to work nicely.
Completes the bot-side of #2486.
What
When the bot fails to add a reaction to a message because the user has the bot blocked (e.g. creating an incident, editing an eval invocation, etc.) the bot handles this via a
log.debug
statement, and if a message is passed to the handler then will also send a message to the message's channel in discord (which deletes after 30 seconds -- long enough to give the user a chance to unblock the bot from that message).Works For:
Testing:
To test this, simply block the bot and then either create an incident, or edit an eval command (or anything else that causes the bot to react to your message).
Example: