Skip to content
Permalink
Browse files

fix cog unloading

  • Loading branch information...
fixator10 committed May 15, 2019
1 parent 5371939 commit 313ebdabe75a29319271bf54710d4f821ea6db72
@@ -19,7 +19,7 @@ def __init__(self, bot: commands.Bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.bot.loop.create_task(self.session.close())

@commands.command(name="prune")
@@ -24,7 +24,7 @@ def __init__(self, bot):
self.config.register_user(**default_user)
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.bot.loop.create_task(self.session.close())

async def api_by_god(self, godname: str, game: str):
@@ -114,7 +114,7 @@ def __init__(self, bot):
self.config.register_guild(**default_guild)
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.session.detach()

@commands.cooldown(1, 10, commands.BucketType.user)
@@ -34,7 +34,7 @@ def __init__(self, bot: commands.Bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.bot.loop.create_task(self.session.close())

@commands.group(name="minecraft", aliases=["mc"])
@@ -46,7 +46,7 @@ def __init__(self, bot: commands.Bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.bot.loop.create_task(self.session.close())

@commands.command(name="thetime")
@@ -20,7 +20,7 @@ def __init__(self, bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.bot.loop.create_task(self.session.close())

@commands.group(autohelp=True)
@@ -23,7 +23,7 @@ def __init__(self, bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)

def __unload(self):
def cog_unload(self):
self.bot.loop.create_task(self.session.close())

@commands.command()

0 comments on commit 313ebda

Please sign in to comment.
You can’t perform that action at this time.