Skip to content

Commit

Permalink
add anime command
Browse files Browse the repository at this point in the history
  • Loading branch information
alexraskin committed Jan 14, 2024
1 parent 371d64b commit 3352ac0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bot/cogs/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,24 @@ async def officeclip(self, ctx: commands.Context) -> Message:
data = await response.json()
random_clip = random.choice(data)
await ctx.send(random_clip["video_url"])

@commands.hybrid_command(name="anime", description="Get a random anime quote")
@commands.guild_only()
@app_commands.guild_only()
async def anime(self, ctx: commands.Context) -> Message:
"""
Get a random anime quote
"""
async with self.client.session.get("https://animechan.xyz/api/random") as response:
if response.status == 200:
quote = await response.json()
embed = Embed(
description=f'"{quote["quote"]}" - {quote["character"]} ({quote["anime"]})',
timestamp=ctx.message.created_at,
)
embed.colour = Colour.blurple()
embed.set_footer(text="https://animechan.xyz/")
await ctx.send(embed=embed)


async def setup(client: commands.Bot) -> None:
Expand Down

0 comments on commit 3352ac0

Please sign in to comment.