attempt to fix the db queries which populate the prefix and lang caches
@@ -13,11 +13,11 @@ class Database(commands.Cog):
return [r[0] for r in botban_records]
async def fetch_all_guild_langs(self):
- lang_records = await self.db.fetch('SELECT lang FROM guilds WHERE (lang != NULL AND lang != "en_us")')
+ lang_records = await self.db.fetch('SELECT lang FROM guilds WHERE lang != $1 AND lang != $2', None, en_us)
return [r[0] for r in lang_records]
async def fetch_all_guild_prefixes(self):
- prefix_records = await self.db.fetch('SELECT prefix FROM guilds WHERE prefix != NULL AND prefix != "/"')
+ prefix_records = await self.db.fetch('SELECT prefix FROM guilds WHERE prefix != $1 AND prefix != $2', None, '/')
return [r[0] for r in prefix_records]
async def fetch_user(self, uid):
