From 9944673b1efb3e3edd9e9a322f8b15a59f621ff1 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sun, 3 Feb 2019 18:59:53 -0600 Subject: [PATCH] Wait until ready, to ensure the database has been loaded --- cogs/osu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/osu.py b/cogs/osu.py index 775d7fb..3c79b28 100644 --- a/cogs/osu.py +++ b/cogs/osu.py @@ -46,6 +46,8 @@ class Osu: async def get_users(self): """A task used to 'cache' all member's and their Osu profile's""" + await self.bot.wait_until_ready() + query = "SELECT id, osu FROM users WHERE osu IS NOT NULL;" rows = await self.bot.db.fetch(query)