From 964565c94255e2f1b374ecc5da6df6c259f876f3 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 7 Oct 2016 18:05:39 -0500 Subject: [PATCH] Used asyncio.sleep and create_task, since call_later cannot be used for coroutines --- cogs/da.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/da.py b/cogs/da.py index b5a01e7..aef0477 100644 --- a/cogs/da.py +++ b/cogs/da.py @@ -15,7 +15,8 @@ class Deviantart: self.session = aiohttp.ClientSession() bot.loop.create_task(self.get_token()) # Lets start the task a few seconds after, to ensure our token gets set - bot.loop.call_later(5, self.post_task) + await asyncio.sleep(5) + bot.loop.create_task(self.post_task()) async def post_task(self): while(True):