1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

cogs/emotes.cog_unload: create 1 task instead of 3

This commit is contained in:
Benjamin Mintz 2019-08-04 10:17:19 +00:00
parent 10ed6bb63f
commit f25ceb32a5

View file

@ -43,14 +43,14 @@ class Emotes(commands.Cog):
self.paginators = weakref.WeakSet() self.paginators = weakref.WeakSet()
def cog_unload(self): def cog_unload(self):
self.bot.loop.create_task(self.http.close()) async def close():
self.bot.loop.create_task(self.aioec.close()) await self.http.close()
await self.aioec.close()
async def stop_all_paginators():
for paginator in self.paginators: for paginator in self.paginators:
await paginator.stop() await paginator.stop()
self.bot.loop.create_task(stop_all_paginators()) self.bot.loop.create_task(close())
async def cog_check(self, context): async def cog_check(self, context):
if not context.guild or not isinstance(context.author, discord.Member): if not context.guild or not isinstance(context.author, discord.Member):