diff options
| author | 2021-03-02 21:58:27 -0600 | |
|---|---|---|
| committer | 2021-03-02 21:58:27 -0600 | |
| commit | 51f16ed0a4e1ce43d7ce4cef1701a886d1b8492d (patch) | |
| tree | 3c7f20365b6ca4f5a85d09e852a293177410b9c1 | |
| parent | finished function (diff) | |
Update earth_photos.py
| -rw-r--r-- | bot/exts/easter/earth_photos.py | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/bot/exts/easter/earth_photos.py b/bot/exts/easter/earth_photos.py index 478502eb..2ca43e42 100644 --- a/bot/exts/easter/earth_photos.py +++ b/bot/exts/easter/earth_photos.py @@ -1,9 +1,10 @@ -import logging -import requests -  import discord  from discord.ext import commands +import logging + +import requests +  from bot.constants import Tokens  log = logging.getLogger(__name__) @@ -15,6 +16,7 @@ class EarthPhotos(commands.Cog):      """This cog contains the command for earth photos."""      def init(self, bot: commands.Bot): +        """Init function."""          self.bot = bot          self.current_channel = None @@ -28,13 +30,13 @@ class EarthPhotos(commands.Cog):          photourls = photojson.get('urls')          urltosend = photourls.get('regular')          userjson = photojson.get('user') -        userName = userjson.get('name') +        username = userjson.get('name')          embed = discord.Embed(title="Earth Photo", description="A photo of Earth from Unsplash.", color=0x66ff00)          embed.set_image(url=urltosend) -        embed.set_footer(text="Image by " + userName + " on Unsplash.") +        embed.set_footer(text="Image by " + username + " on Unsplash.")          await ctx.send(embed=embed)  def setup(bot: commands.Bot) -> None: -    """Cog load""" +    """Cog load."""      bot.add_cog(EarthPhotos(bot))  |