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
Discord.py added a long time ago a new on_interaction_error event handler, specifically made to handle errors from app commands, buttons, modals, autocompletion etc.
This handled has not been added to our Error cog, so these errors are only printed into the bot console and will never show in our error channel for example.
EDIT: my bad, the on_interaction_error is not a native d.py event but one I had to create myself for the needs of my bot, sorry for the confusion.
Here is how I did it:
the Client.tree attribute has an on_error method called "when any command raises an AppCommandError" (from the d.py doc)
I overwrote this method by my own method, which basically calls the event dispatcher with an unique event: self.dispatch("interaction_error", interaction, error)
I then added an event listener in the Error cog, listening to this unique event (the one I linked in my first comment)
I believe this is the best way to do things and will allow us to more easily catch interaction-related errors
Discord.py added a long time ago a new
on_interaction_error
event handler, specifically made to handle errors from app commands, buttons, modals, autocompletion etc.This handled has not been added to our Error cog, so these errors are only printed into the bot console and will never show in our error channel for example.
Check https://github.com/ZRunner/Axobot/blob/ccdbb05d59cc0b688080e7f6c3ef944fda459888/fcts/errors.py#L233 for an example of implementation (could be done better)
The text was updated successfully, but these errors were encountered: