mirror of
https://git.mctaylors.ru/mctaylors/Lurker.git
synced 2024-11-23 05:38:03 +03: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
|
return
|
||||||
|
|
||||||
if x > y:
|
if x > y:
|
||||||
message = randrange(y, x + 1)
|
result = randrange(y, x + 1)
|
||||||
await ctx.send(f"**{message}** `({y};{x})`")
|
await ctx.send(extensions.random_message(result, y, x))
|
||||||
return
|
return
|
||||||
|
|
||||||
message = randrange(x, y + 1)
|
result = randrange(x, y + 1)
|
||||||
await ctx.send(f"**{message}** `({x};{y})`")
|
await ctx.send(extensions.random_message(result, x, y))
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def timestamp(self, ctx: commands.Context):
|
async def timestamp(self, ctx: commands.Context):
|
||||||
|
|
|
@ -1,2 +1,8 @@
|
||||||
def icon_info(icon):
|
def icon_info(icon):
|
||||||
return f"[{icon.filename}](<{icon.url}>) ({icon.width}x{icon.height})"
|
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