DenverCoder1 / jct-discord-bot

Bot for JCT ESP CompSci Discord Server
MIT License
11 stars 1 forks source link

Raised Exceptions are not centrally handled #369

Closed benjitusk closed 2 years ago

benjitusk commented 2 years ago

The following cases can cause the bot to crash:

DenverCoder1 commented 2 years ago

I think it used to handle all exceptions, possibly only before the first slash command migration.

When migrating to nextcord, we should be able to catch anything unhandled with an on_application_command_error listener or on_error I think.

benjitusk commented 2 years ago

So in order to catch all exceptions in one place, I should not deal with them individually, but I should leave them to be handled by nextcord's on_error method, which would presumably send a user-friendly ephemeral message. Is that right?

DenverCoder1 commented 2 years ago

Yeah, if they all are implemented about the same way, it's better to do it in one place.

Note that if the command is already responded to when the error occurs, it can't send another response, only a followup.

interaction.send can be used to send a response or followup based on whether one has been sent yet or not.

benjitusk commented 2 years ago

Closed by b6b2c99