SharkyTheKing / Sharky

Sharky's Cogs. If you have any suggestions or issues, please feel free to add them here.
19 stars 8 forks source link

Inadequate error handling methods #123

Open vsenjoyer opened 2 years ago

vsenjoyer commented 2 years ago

Hi there! I was scrolling through your code when I noticed you're using an if statement rather than a try-except statement.

there are actually two of them that are very useful- commands.BotMissingPermission and Forbidden.MissingPermissions.

using these, it doesn't matter which permission you don't have- the error will still be thrown and you don't have to worry about handler-proofing your bot with every possible permission that might be denied.

FYI- I'm pretty sure Forbidden.MissingPermission is an HTTPException.

vsenjoyer commented 2 years ago

I'm happy to make a PR when i get the chance, btw. edit: on my phone right now.