diff options
author | 2018-10-10 12:02:14 +0200 | |
---|---|---|
committer | 2018-10-10 12:02:14 +0200 | |
commit | 5cf56e648416b22d50ef3ab0f230618ed5ab2925 (patch) | |
tree | 92b73a6a450adbdb6be7feca1612255e47995961 /bot | |
parent | Add random spooky gif feature. (diff) |
Refactoring.
Diffstat (limited to 'bot')
-rw-r--r-- | bot/cogs/gif.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/cogs/gif.py b/bot/cogs/gif.py index 559e0eaf..cacb77ce 100644 --- a/bot/cogs/gif.py +++ b/bot/cogs/gif.py @@ -4,8 +4,7 @@ import aiohttp from discord.ext import commands -class Gif: - +class SpookyGif: """ A cog to fetch a random spooky gif from the web! """ @@ -16,6 +15,10 @@ class Gif: @commands.command() async def gif(self, ctx): + """ + Fetches a random gif from the GIPHY API and responds with it. + """ + async with aiohttp.ClientSession() as session: params = {'api_key': self.GIPHY_TOKEN, 'tag': 'halloween', 'rating': 'g'} # Make a GET request to the Giphy API to get a random halloween gif. @@ -26,4 +29,4 @@ class Gif: def setup(bot): - bot.add_cog(Gif(bot)) + bot.add_cog(SpookyGif(bot)) |