ignore unknown commands
This commit is contained in:
parent
8ee38cd4f9
commit
6da7a3cc36
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ class Bot(commands.Bot):
|
|||
|
||||
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()
|
||||
|
||||
for file in listdir("modules"):
|
||||
|
|
Loading…
Reference in a new issue