From d0cacd733455f54a11fafd94f85de9a8d53721b3 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sun, 30 Jul 2017 20:12:36 -0500 Subject: [PATCH] Ensure settings is an empty dictionary by default --- cogs/interaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/interaction.py b/cogs/interaction.py index db3187e..a262ec4 100644 --- a/cogs/interaction.py +++ b/cogs/interaction.py @@ -161,7 +161,7 @@ class Interaction: user = ctx.message.author # Lets get the settings - settings = self.bot.db.load('server_settings', key=ctx.message.guild.id) + settings = self.bot.db.load('server_settings', key=ctx.message.guild.id) or {} # Get the custom messages we can use custom_msgs = settings.get('hugs') # if they exist, then we want to see if we want to use default as well @@ -238,7 +238,7 @@ class Interaction: battleP2 = ctx.message.author # Lets get the settings - settings = self.bot.db.load('server_settings', key=ctx.message.guild.id) + settings = self.bot.db.load('server_settings', key=ctx.message.guild.id) or {} # Get the custom messages we can use custom_msgs = settings.get('battles') # if they exist, then we want to see if we want to use default as well