From 0bb32b4634f6becf944dff04642918a290f9fcfb Mon Sep 17 00:00:00 2001 From: Suhail Date: Fri, 5 Apr 2019 18:13:41 +0100 Subject: Replaced new ClientSession with the one already located in the bot --- bot/seasons/easter/avatar_easterifier.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bot') diff --git a/bot/seasons/easter/avatar_easterifier.py b/bot/seasons/easter/avatar_easterifier.py index b81f7434..9f7ea271 100644 --- a/bot/seasons/easter/avatar_easterifier.py +++ b/bot/seasons/easter/avatar_easterifier.py @@ -4,7 +4,6 @@ from io import BytesIO from pathlib import Path from typing import Union -import aiohttp import discord from PIL import Image from PIL.ImageOps import posterize @@ -24,7 +23,6 @@ class AvatarEasterifier(commands.Cog): def __init__(self, bot): self.bot = bot - self.session = aiohttp.ClientSession() @staticmethod def closest(x): @@ -73,7 +71,7 @@ class AvatarEasterifier(commands.Cog): async with ctx.typing(): # Grabs image of avatar - async with self.session.get(ctx.author.avatar_url_as(size=256)) as resp: + async with self.bot.http_session.get(ctx.author.avatar_url_as(size=256)) as resp: image_bytes = await resp.read() old = Image.open(BytesIO(image_bytes)) -- cgit v1.2.3