mirror of
https://git.mctaylors.ru/mctaylors/Lurker.git
synced 2024-11-26 17:08:34 +00:00
random: Show the given range as a table
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
4211f72b9d
commit
befd494de2
2 changed files with 10 additions and 4 deletions
|
@ -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):
|
||||
|
|
|
@ -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}|")
|
||||
|
|
Loading…
Reference in a new issue