dragon-bot/app/cogs/animal_functions.py

84 lines
2.2 KiB
Python

from discord.ext import commands
import discord
import animals
class AnimalFunctions(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.command(name="redpanda")
async def redpanda(self, ctx: commands.Context):
await ctx.reply(animals.get_red_panda())
@commands.command(name="panda")
async def panda(self, ctx: commands.Context):
await ctx.reply(animals.get_panda())
@commands.command(name="koala")
async def koala(self, ctx: commands.Context):
await ctx.reply(animals.get_koala())
@commands.command(name="racoon")
async def racoon(self, ctx: commands.Context):
await ctx.reply(animals.get_racoon())
@commands.command(name="fox")
async def fox(self, ctx: commands.Context):
await ctx.reply(animals.get_fox())
@commands.command(name="cat")
async def cat(self, ctx: commands.Context):
await ctx.reply(animals.get_cat())
@commands.command(name="kangaroo")
async def kangaroo(self, ctx: commands.Context):
await ctx.reply(animals.get_kangaroo())
@commands.command(name="dog")
async def dog(self, ctx: commands.Context):
await ctx.reply(animals.get_dog())
@commands.command(
name="sheeb",
aliases=["shiba", "shib", "shoob", "sheeber", "shoober", "shobe", "shibe"],
)
async def sheeb(self, ctx: commands.Context):
await ctx.reply(animals.random_sheeb())
@commands.command(name="birb")
async def birb(self, ctx: commands.Context):
await ctx.reply(animals.get_birb())
@commands.command(name="dale", aliases=["cowboy"])
async def dale(self, ctx: commands.Context):
# If the file picked is too large, try again
dale_pic = None
while not dale_pic:
try:
dale_pic = animals.dale()
await ctx.reply(file=discord.File(dale_pic))
except Exception:
print("File too large, trying again")
dale_pic = None
@commands.command(name="rat")
async def rat(self, ctx: commands.Context):
import animals
await ctx.reply(animals.get_rat())
def setup(bot):
bot.add_cog(AnimalFunctions(bot))