1
0
Fork 0
mirror of synced 2024-06-26 10:10:44 +12:00

Used asyncio.sleep and create_task, since call_later cannot be used for coroutines

This commit is contained in:
Phxntxm 2016-10-07 18:05:39 -05:00
parent 7a5f26a6ff
commit 964565c942

View file

@ -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):