add fetch_all_balances db helper method
@@ -43,6 +43,9 @@ class Database(commands.Cog):
# we can do this because self.fetch_user ensures user is not None
return (await self.fetch_user(uid))['emeralds']
+ async def fetch_all_balances(self):
+ return await self.db.fetch('SELECT uid, emeralds FROM users')
+
async def set_balance(self, uid, emeralds):
await self.fetch_user(uid)
async with self.db.acquire() as con:
