explicitly specify replace into fields

This commit is contained in:
Infinidoge 2024-12-23 00:50:50 -05:00
parent 9885dce544
commit ecf96b427b
Signed by: Infinidoge
SSH key fingerprint: SHA256:GT2StvPQMMfFHyiiFJymQxfTG/z6EWLJ6NWItf5K5sA
2 changed files with 3 additions and 6 deletions

View file

@ -78,10 +78,7 @@ class Nomen(Bot):
return prefix return prefix
async def set_guild_prefix(self, guild: Guild, prefix): async def set_guild_prefix(self, guild: Guild, prefix):
await self.db.execute( await self.db.execute("REPLACE INTO guilds (guild_id, prefix) VALUES(?, ?)", (guild.id, prefix))
"REPLACE INTO guilds VALUES(?, ?)",
(guild.id, prefix),
)
self.prefixes[guild.id] = prefix self.prefixes[guild.id] = prefix
async def start(self, *args, **kwargs): async def start(self, *args, **kwargs):

View file

@ -91,7 +91,7 @@ You may want to `{ctx.clean_prefix}nomen export` first"""
f"You have now opted-out and will no longer trigger or receive notifications. To opt back in, run `{ctx.clean_prefix}nomen opt-in`" f"You have now opted-out and will no longer trigger or receive notifications. To opt back in, run `{ctx.clean_prefix}nomen opt-in`"
) )
await self.bot.db.execute("REPLACE INTO users VALUES(?, 1)", (ctx.author.id,)) await self.bot.db.execute("REPLACE INTO users (user_id, disabled) VALUES(?, 1)", (ctx.author.id,))
await self.bot.db.commit() await self.bot.db.commit()
@nomen.command(name="opt-in") @nomen.command(name="opt-in")
@ -106,5 +106,5 @@ You may want to `{ctx.clean_prefix}nomen export` first"""
f"You have opted back in and will now trigger and receive notifications. To opt out, run `{ctx.clean_prefix}nomen opt-out`" f"You have opted back in and will now trigger and receive notifications. To opt out, run `{ctx.clean_prefix}nomen opt-out`"
) )
await self.bot.db.execute("REPLACE INTO users VALUES(?, 0)", (ctx.author.id,)) await self.bot.db.execute("REPLACE INTO users (user_id, disabled) VALUES(?, 0)", (ctx.author.id,))
await self.bot.db.commit() await self.bot.db.commit()