bot icon indicating copy to clipboard operation
bot copied to clipboard

Check for commands being None in try_get_tag and try_silence

Open wookie184 opened this issue 3 years ago • 0 comments

Previously, if the commands were not loaded and you attempted to invoke a command that doesn't exist (e.g. !hello), an error would be raised:

bot_1          | Traceback (most recent call last):
bot_1          |   File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 456, in _run_event
bot_1          |     await coro(*args, **kwargs)
bot_1          |   File "/bot/bot/exts/backend/error_handler.py", line 67, in on_command_error
bot_1          |     if await self.try_silence(ctx):
bot_1          |   File "/bot/bot/exts/backend/error_handler.py", line 125, in try_silence
bot_1          |     args = ctx.message.content.lower().split(" ")
bot_1          | AttributeError: 'NoneType' object has no attribute 'can_run'

wookie184 avatar Sep 10 '22 17:09 wookie184