diff options
| author | 2019-05-11 04:51:30 +1000 | |
|---|---|---|
| committer | 2019-05-11 04:51:30 +1000 | |
| commit | 0e2c6a1b0daef5b569da7652801b5725bf1ed95b (patch) | |
| tree | c3d57e50f2ba07cb2d9e7476d3b9441c1f671bd9 /bot/seasons/halloween/spookyavatar.py | |
| parent | not importing aiohttp now (diff) | |
| parent | Merge pull request #198 from Suhail6inkling/constants_fix (diff) | |
Merge branch 'master' into hanukkah_embed_iceman
Diffstat (limited to 'bot/seasons/halloween/spookyavatar.py')
| -rw-r--r-- | bot/seasons/halloween/spookyavatar.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/bot/seasons/halloween/spookyavatar.py b/bot/seasons/halloween/spookyavatar.py index 032ad352..15c7c431 100644 --- a/bot/seasons/halloween/spookyavatar.py +++ b/bot/seasons/halloween/spookyavatar.py @@ -13,18 +13,14 @@ log = logging.getLogger(__name__) class SpookyAvatar(commands.Cog): - - """ - A cog that spookifies an avatar. - """ + """A cog that spookifies an avatar.""" def __init__(self, bot): self.bot = bot async def get(self, url): - """ - Returns the contents of the supplied url. - """ + """Returns the contents of the supplied url.""" + async with aiohttp.ClientSession() as session: async with session.get(url) as resp: return await resp.read() @@ -32,9 +28,8 @@ class SpookyAvatar(commands.Cog): @commands.command(name='savatar', aliases=('spookyavatar', 'spookify'), brief='Spookify an user\'s avatar.') async def spooky_avatar(self, ctx, user: discord.Member = None): - """ - A command to print the user's spookified avatar. - """ + """A command to print the user's spookified avatar.""" + if user is None: user = ctx.message.author @@ -54,5 +49,7 @@ class SpookyAvatar(commands.Cog): def setup(bot): + """Spooky avatar Cog load.""" + bot.add_cog(SpookyAvatar(bot)) log.info("SpookyAvatar cog loaded") |