random: Show the given range as a table

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-11-07 00:33:32 +03:00
parent 4211f72b9d
commit befd494de2
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2
2 changed files with 10 additions and 4 deletions

View file

@ -36,12 +36,12 @@ class Client(commands.CommandsClient):
return
if x > y:
message = randrange(y, x + 1)
await ctx.send(f"**{message}** `({y};{x})`")
result = randrange(y, x + 1)
await ctx.send(extensions.random_message(result, y, x))
return
message = randrange(x, y + 1)
await ctx.send(f"**{message}** `({x};{y})`")
result = randrange(x, y + 1)
await ctx.send(extensions.random_message(result, x, y))
@commands.command()
async def timestamp(self, ctx: commands.Context):

View file

@ -1,2 +1,8 @@
def icon_info(icon):
return f"[{icon.filename}](<{icon.url}>) ({icon.width}x{icon.height})"
def random_message(result, min, max):
return (f"## {result}\n"
f"| Min | Max |\n"
f"| --- | --- |\n"
f"|{min}|{max}|")