Code Cleanup
This commit is contained in:
parent
d2622e25e8
commit
fa34f8510d
13 changed files with 98 additions and 50 deletions
|
@ -1,3 +1,8 @@
|
|||
'''
|
||||
This is the cog that allows users to
|
||||
fetch an AI-generated inspirational quote
|
||||
made by Inspirobot
|
||||
'''
|
||||
import discord
|
||||
|
||||
from discord.ext import commands
|
||||
|
@ -6,12 +11,12 @@ from util import config
|
|||
|
||||
class Inspirobot(commands.Cog):
|
||||
|
||||
def __init__(self, client):
|
||||
def __init__(self, client : discord.Client):
|
||||
self.client = client
|
||||
|
||||
@commands.command(name="Inspirobot", description="Sends a randomly generated inspirational quote", aliases=["inspiration", "inspiro"])
|
||||
@commands.cooldown(1, 5)
|
||||
async def inspirobot(self, ctx):
|
||||
async def inspirobot(self, ctx : commands.Context):
|
||||
image = inspirobot.get_inspirational_quote()
|
||||
if image is None:
|
||||
await ctx.message.add_reaction("⚠️")
|
||||
|
@ -20,5 +25,5 @@ class Inspirobot(commands.Cog):
|
|||
embed.set_image(url=image)
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
def setup(client):
|
||||
def setup(client : discord.Client):
|
||||
client.add_cog(Inspirobot(client))
|
Loading…
Add table
Add a link
Reference in a new issue