timestamp: Add list[str] for timestamp styles

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-11-07 00:43:07 +03:00
parent befd494de2
commit b5b801f07f
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2

View file

@ -46,17 +46,15 @@ class Client(commands.CommandsClient):
@commands.command()
async def timestamp(self, ctx: commands.Context):
"""Shows current timestamp"""
message = trunc(time())
await ctx.send(f"## {message}\n"
timestamp = trunc(time())
table = str()
styles = ['d', 'D', 't', 'T', 'f', 'F', 'R']
for style in styles:
table = table + f"\n| `<t:{timestamp}:{style}>` | <t:{timestamp}:{style}> |"
await ctx.send(f"## {timestamp}\n"
f"| Chat syntax | Result |\n"
f"| --- | --- |\n"
f"| `<t:{message}:d>` | <t:{message}:d> |\n"
f"| `<t:{message}:D>` | <t:{message}:D> |\n"
f"| `<t:{message}:t>` | <t:{message}:t> |\n"
f"| `<t:{message}:T>` | <t:{message}:T> |\n"
f"| `<t:{message}:f>` | <t:{message}:f> |\n"
f"| `<t:{message}:F>` | <t:{message}:F> |\n"
f"| `<t:{message}:R>` | <t:{message}:R> |")
f"| --- | --- |"
+ table)
@commands.command()
async def self(self, ctx: commands.Context):