Code Cleanup

This commit is contained in:
Robert 2020-01-08 02:26:36 +01:00
parent d2622e25e8
commit fa34f8510d
13 changed files with 98 additions and 50 deletions

View file

@ -1,3 +1,7 @@
'''
This cog is capable of communicating with the
NASA API
'''
import discord
from discord.ext import commands
from api import nasa
@ -5,12 +9,12 @@ from util import config
class Nasa(commands.Cog):
def __init__(self, client):
def __init__(self, client: discord.Client):
self.client = client
@commands.command(name="APOD", description="Posts NASA's picture of the day.")
@commands.cooldown(1, 30)
async def apod(self, ctx):
async def apod(self, ctx: commands.Context):
url = nasa.image_of_the_day()
embed = discord.Embed(title="Astronomy Picture of the day", color=int(config.settings["color"], 16))
embed.set_image(url=url)
@ -18,5 +22,5 @@ class Nasa(commands.Cog):
await ctx.send(embed=embed)
def setup(client):
def setup(client: discord.Client):
client.add_cog(Nasa(client))