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