properly insert and commit prefix changes
This commit is contained in:
parent
ed0ad1bea6
commit
69ce9f23b7
1 changed files with 5 additions and 1 deletions
|
@ -79,7 +79,11 @@ 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("UPDATE guilds SET prefix = ? WHERE guild_id=?", (prefix, guild.id))
|
await self.db.execute(
|
||||||
|
"INSERT INTO guilds VALUES(:guild_id, :prefix) ON CONFLICT(guild_id) DO UPDATE SET prefix = :prefix",
|
||||||
|
{"guild_id": guild.id, "prefix": prefix},
|
||||||
|
)
|
||||||
|
await self.db.commit()
|
||||||
self.prefixes[guild.id] = prefix
|
self.prefixes[guild.id] = prefix
|
||||||
|
|
||||||
async def start(self, *args, **kwargs):
|
async def start(self, *args, **kwargs):
|
||||||
|
|
Loading…
Add table
Reference in a new issue