From a22cf3e41487acc4178afb5cee4e7aa4ea71835d Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 8 Mar 2017 02:26:50 -0600 Subject: [PATCH] Corrected some issues with the database --- cogs/mod.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogs/mod.py b/cogs/mod.py index 42eea4a..ec3a7c0 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -111,8 +111,8 @@ class Mod: key = str(ctx.message.guild.id) entry = {'server_id': key, 'notification_channel': str(channel.id)} - if not await utils.update_content('server_alerts', entry, key): - await utils.add_content('server_alerts', entry) + if not await utils.update_content('server_settings', entry, key): + await utils.add_content('server_settings', entry) await ctx.send("I have just changed this server's 'notifications' channel" "\nAll notifications will now go to `{}`".format(channel)) @@ -131,8 +131,8 @@ class Mod: key = str(ctx.message.guild.id) entry = {'server_id': key, 'join_leave': on_off} - if not await utils.update_content('user_notifications', entry, key): - await utils.add_content('user_notifications', entry) + if not await utils.update_content('server_settings', entry, key): + await utils.add_content('server_settings', entry) fmt = "notify" if on_off else "not notify" await ctx.send("This server will now {} if someone has joined or left".format(fmt)) @@ -226,7 +226,7 @@ class Mod: server_settings = await utils.get_content('server_settings', str(ctx.message.guild.id)) try: server_perms = server_settings['permissions'] - except (TypeError, IndexError): + except (TypeError, IndexError, KeyError): server_perms = {} perms_value = server_perms.get(cmd.qualified_name)