ignore unknown commands
This commit is contained in:
parent
8ee38cd4f9
commit
6da7a3cc36
1 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,11 @@ class Bot(commands.Bot):
|
|||
# print(f"{message.author.name}: {message.content}")
|
||||
|
||||
await self.handle_commands(message) # Let the bot know we want to handle and invoke our commands
|
||||
|
||||
async def event_command_error(self, _, error):
|
||||
if isinstance(error, commands.errors.CommandNotFound): # Ignore unknown commands (useful because custom commands aren’t known)
|
||||
return
|
||||
raise error
|
||||
|
||||
client = Bot()
|
||||
|
||||
|
|
Loading…
Reference in a new issue