diff options
Diffstat (limited to '')
| -rw-r--r-- | pydis_site/apps/content/resources/guides/python-guides/proper-error-handling.md | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/pydis_site/apps/content/resources/guides/python-guides/proper-error-handling.md b/pydis_site/apps/content/resources/guides/python-guides/proper-error-handling.md index 9307169d..e0606625 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/proper-error-handling.md +++ b/pydis_site/apps/content/resources/guides/python-guides/proper-error-handling.md @@ -16,7 +16,7 @@ class MyBot(commands.Bot):    def __init__(self, *args, **kwargs):      super().__init__(*args, **kwargs) -     +    async def on_command_error(self, ctx: commands.Context, error):      # Handle your errors here      if isinstance(error, commands.MemberNotFound): @@ -28,7 +28,7 @@ class MyBot(commands.Bot):        # All unhandled errors will print their original traceback        print(f'Ignoring exception in command {ctx.command}:', file=sys.stderr)        traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr) -       +  bot = MyBot(command_prefix="!", intents=discord.Intents.default())  bot.run("token") @@ -65,6 +65,6 @@ Make sure to import `traceback` and `sys`!  ------------------------------------------------------------------------------------------------------------- -Useful Links:  +Useful Links:  - [FAQ](https://discordpy.readthedocs.io/en/latest/faq.html)  - [Simple Error Handling](https://gist.github.com/EvieePy/7822af90858ef65012ea500bcecf1612) | 
