From a4ae8fd6b8778d077f4d85092d0875cf24eeaa0f Mon Sep 17 00:00:00 2001 From: Akumatic Date: Tue, 22 Jan 2019 01:32:21 +0100 Subject: [PATCH] nonexistent commands wont raise exception anymore; suggestionChannel is added in serverconfig --- akuma.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/akuma.py b/akuma.py index 3b9cce9..9d60a7e 100644 --- a/akuma.py +++ b/akuma.py @@ -1,5 +1,6 @@ import json, discord from discord.ext import commands +from discord.ext.commands import CommandNotFound #config files cFile = "settings.json" @@ -26,7 +27,7 @@ async def on_ready(): @bot.event async def on_guild_join(guild): - s[str(guild.id)] = {"adminRole": "", "modRole": "", "joinMessage" : "", "suggestionChannel": 0, "modChannel": 0} + s[str(guild.id)] = {"adminRole": "", "modRole": "", "joinMessage" : "", "suggestionChannel": 0, "modChannel": 0, "announcementChannel": 0} writeServer(s) @bot.event @@ -34,6 +35,12 @@ async def on_guild_remove(guild): del s[str(guild.id)] writeServer(s) +@bot.event +async def on_command_error(ctx, error): + if isinstance(error, CommandNotFound): + return + raise error + @bot.command(hidden=True) async def printExt(ctx): """Prints out every loaded extension"""