add db helper method to edit the guilds table
@@ -36,6 +36,11 @@ class Database(commands.Cog):
return g
+ async def set_guild_attr(gid, attr, value):
+ await self.fetch_guild()
+ async with self.db.acquire() as con:
+ await con.execute(f'UPDATE guilds SET {attr} = $1 WHERE gid = $2', value, gid)
+
async def drop_guild(gid):
async with self.db.acquire() as con:
await con.execute('DELETE FROM guilds WHERE gid = $1', gid)
