Added .gitignore, Added Inspirobot
This commit is contained in:
parent
ca91cfddaf
commit
2f16876177
5 changed files with 61 additions and 8 deletions
23
cogs/api/inspirobot.py
Normal file
23
cogs/api/inspirobot.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import discord
|
||||
|
||||
from discord.ext import commands
|
||||
from api import inspirobot
|
||||
|
||||
class Inspirobot(commands.Cog):
|
||||
|
||||
def __init__(self, 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):
|
||||
image = inspirobot.get_inspirational_quote()
|
||||
if image is None:
|
||||
await ctx.message.add_reaction("⚠️")
|
||||
else:
|
||||
embed = discord.Embed(title="InspiroBot", color=0x111387)
|
||||
embed.set_image(url=image)
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(Inspirobot(client))
|
Loading…
Add table
Add a link
Reference in a new issue