From b2f2120529d1e11f7438be52fb584fee3580eb87 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sun, 17 Feb 2019 14:07:26 -0600 Subject: [PATCH] Ensure entry exists before trying to set anything --- cogs/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/config.py b/cogs/config.py index 6403e66..e193b8e 100644 --- a/cogs/config.py +++ b/cogs/config.py @@ -726,6 +726,9 @@ WHERE except AttributeError: await ctx.send(f"{option} is not a valid config option. Use {ctx.prefix}config to list all config options") else: + # First make sure there's an entry for this guild before doing anything + await ctx.bot.db.execute("INSERT INTO guilds(id) VALUES ($1)", ctx.guild.id) + try: await coro(ctx, setting=setting) except WrongSettingType as exc: