From 867fea273b7373b69b477e4e015882ddedaab08b Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sun, 17 Feb 2019 14:09:06 -0600 Subject: [PATCH] Ignore if the guild already exists --- cogs/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cogs/config.py b/cogs/config.py index 035252d..446e2a4 100644 --- a/cogs/config.py +++ b/cogs/config.py @@ -727,7 +727,10 @@ WHERE 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 ctx.bot.db.execute("INSERT INTO guilds(id) VALUES ($1)", ctx.guild.id) + except UniqueViolationError: + pass try: await coro(ctx, setting=setting)