mirror of
https://git.mctaylors.ru/mctaylors/Lurker.git
synced 2024-11-25 04:48:02 +03:00
Compare commits
5 commits
e1c0ee065a
...
b5b801f07f
Author | SHA1 | Date | |
---|---|---|---|
b5b801f07f | |||
befd494de2 | |||
4211f72b9d | |||
92797df873 | |||
4b7b7bc062 |
4 changed files with 27 additions and 10 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,2 +1,6 @@
|
|||
.idea/
|
||||
.venv/
|
||||
.venv/
|
||||
build/
|
||||
dist/
|
||||
__pycache__/
|
||||
*.spec
|
24
client.py
24
client.py
|
@ -36,18 +36,25 @@ class Client(commands.CommandsClient):
|
|||
return
|
||||
|
||||
if x > y:
|
||||
message = randrange(y, x + 1)
|
||||
await ctx.send(f"**{str(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"**{str(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):
|
||||
"""Shows current timestamp"""
|
||||
message = trunc(time())
|
||||
await ctx.send(str(message))
|
||||
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"| --- | --- |"
|
||||
+ table)
|
||||
|
||||
@commands.command()
|
||||
async def self(self, ctx: commands.Context):
|
||||
|
@ -99,7 +106,6 @@ class Client(commands.CommandsClient):
|
|||
if server.banner is not None:
|
||||
banner = extensions.icon_info(server.banner)
|
||||
|
||||
state = server.state # used for statistics
|
||||
await ctx.send(f"## {server.name}\n"
|
||||
f"{description}\n"
|
||||
f"| ID | `{server.id}` |\n| --- | --- |\n"
|
||||
|
@ -108,7 +114,7 @@ class Client(commands.CommandsClient):
|
|||
f"| Server banner | {banner} |\n"
|
||||
f"| Server owner | {server.owner.original_name}#{server.owner.discriminator} |\n"
|
||||
f"---\n| Statistics | Value |\n| --- | --- |\n"
|
||||
f"| Members | {len(state.users)} |\n"
|
||||
f"| Channels | {len(state.channels)} |\n"
|
||||
f"| Members | {len(server.members)} |\n"
|
||||
f"| Channels | {len(server.channels)} |\n"
|
||||
f"| Roles | {len(server.roles)} |\n"
|
||||
f"| Emojis | {len(server.emojis)} |")
|
||||
|
|
|
@ -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}|")
|
||||
|
|
1
main.py
1
main.py
|
@ -4,6 +4,7 @@ import client
|
|||
import asyncio
|
||||
|
||||
from next.ext.commands import DefaultHelpCommand
|
||||
from sys import exit
|
||||
|
||||
|
||||
async def main():
|
||||
|
|
Loading…
Reference in a new issue