1
0
Fork 0
mirror of synced 2024-05-03 04:02:28 +12:00

Quote because postgres is stupid

This commit is contained in:
phxntxm 2019-03-01 20:05:29 -06:00
parent b75b4f7776
commit f7e2bc673f

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}) VALUES ($1, $2)", ctx.guild.id, setting)
return await ctx.bot.db.execute(f"INSERT INTO guilds (id, {opt!r}) 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)