1
0
Fork 0
mirror of synced 2024-05-03 12:12:31 +12:00

Quote because postgres is stupid

This commit is contained in:
phxntxm 2019-03-01 20:10:48 -06:00
parent f7e2bc673f
commit b0c4496f88

View file

@ -50,7 +50,7 @@ class GuildConfiguration(commands.Cog):
if opt == "prefix":
ctx.bot.cache.update_prefix(ctx.guild, setting)
try:
return await ctx.bot.db.execute(f"INSERT INTO guilds (id, {opt!r}) VALUES ($1, $2)", ctx.guild.id, setting)
return await ctx.bot.db.execute(f"INSERT INTO guilds (id, \"{opt}\") VALUES ($1, $2)", ctx.guild.id, setting)
except UniqueViolationError:
return await ctx.bot.db.execute(f"UPDATE guilds SET {opt} = $1 WHERE id = $2", setting, ctx.guild.id)