1
0
Fork 0
mirror of https://git.mctaylors.ru/mctaylors/Lurker.git synced 2024-11-23 05:48:03 +03:00

server: Fix stats by using ctx.author.server

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-11-06 23:12:29 +03:00
parent 8fbd3356c0
commit 4b7b7bc062
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2
3 changed files with 8 additions and 4 deletions

6
.gitignore vendored
View file

@ -1,2 +1,6 @@
.idea/ .idea/
.venv/ .venv/
build/
dist/
__pycache__/
*.spec

View file

@ -99,7 +99,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 +107,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)} |")

View file

@ -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():