Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cogs/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ async def hackertext(self, ctx: ApplicationContext, text: str):
text = text.replace("u", "x")
text = text.replace("t", "7")
await ctx.respond(text)

@commands.slash_command(
name="randomnumber",
description="Choose a random number from x to y."
)
@option(name="x", description="The minimum limit of the random number.", type=int)
@option(name="y", description="The maximum limit of the random number.", type=int)
async def randomnumber(self, ctx: ApplicationContext, x: int, y: int):
"""Choose a random number from x to y."""
if x > y:
return await ctx.respond(":x: Your minimum limit needs to be lower than the maximum limit!", ephemeral=True)
await ctx.respond(f"Your random number is `{random.randint(x, y)}`\n\nMinimum limit: `{x}`\nMaximum limit: `{y}`")

# Initialization
def setup(bot): bot.add_cog(Fun(bot))