#how to get missing perms forbidden

1 messages · Page 1 of 1 (latest)

red salmon
#

how to get missing perms if error is forbidden?
like if it's forbidden i want get "missing ban perms" or smth like that

vapid jackalBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

quasi violet
#
try:
  do_step_that_needs_a_perm()
except:
  print("youre missing these perms:")
worthy bramble
#

please dont use an except without a specified error

#
try:
    step_with_http_error()
except ipy.errors.HTTPException:
    ...
#

you can even do except HTTPException as e: to have the error object as e

#

regardless, most of this is basic error stuff, so...

red salmon
#

No, like

#

If the bot missing ban perms, timeout perms, kick perms, it says that

#

Like

#

"Missing permissions Ban Permissions, Timeout permissions etc.

worthy bramble
#

yes that is an error from discord, which are typically http errors

red salmon
#

Some bots has it

worthy bramble
#

well yes they implement it using their own error handling