Curiosity-org / Gipsy

Gipsy is a multi-purpose discord bot which aim to be as modular and user-friendly as possible
CeCILL Free Software License Agreement v2.1
13 stars 6 forks source link

Errors from interactions are not handled by the Errors cog #213

Open ZRunner opened 1 year ago

ZRunner commented 1 year ago

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)

ZRunner commented 1 year ago

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:

I believe this is the best way to do things and will allow us to more easily catch interaction-related errors