diff --git a/cogs/admin.py b/cogs/admin.py index 71c714c..870f8ba 100644 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -11,6 +11,7 @@ from libbot.sync import config_get as sync_config_get from enums.colors import Color from modules.scheduled import scheduler from modules.utils_sync import guild_name +from modules.waifu_pics import waifu_pics logger = logging.getLogger(__name__) @@ -186,6 +187,7 @@ class Admin(commands.Cog): ) scheduler.shutdown() await self.client.close() + await waifu_pics._client_session.close() sys.exit() logging.warning( diff --git a/cogs/fun.py b/cogs/fun.py index d2140b8..3865352 100644 --- a/cogs/fun.py +++ b/cogs/fun.py @@ -1,6 +1,5 @@ import logging -from WaifuPicsPython import WaifuAsync from discord import ApplicationContext, Embed, User, option, slash_command from discord.ext import commands from libbot import config_get @@ -8,11 +7,10 @@ from libbot.pycord.classes import PycordBot from libbot.sync import config_get as sync_config_get from modules.utils_sync import guild_name +from modules.waifu_pics import waifu_pics logger = logging.getLogger(__name__) -wafiu_pics = WaifuAsync() - class Fun(commands.Cog): def __init__(self, client: PycordBot): @@ -35,7 +33,7 @@ class Fun(commands.Cog): action = await config_get("category", "actions", type) action_verb = await config_get("action", "actions", type) - image = await wafiu_pics.sfw(action) + image = await waifu_pics.sfw(action) logger.info( "User %s (%s) %s %s (%s) with image %s", diff --git a/modules/waifu_pics.py b/modules/waifu_pics.py new file mode 100644 index 0000000..fe3d158 --- /dev/null +++ b/modules/waifu_pics.py @@ -0,0 +1,3 @@ +from WaifuPicsPython import WaifuAsync + +waifu_pics: WaifuAsync = WaifuAsync()