1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-03 02:23:13 +00:00
Lumi/modules/misc/info.py

44 lines
1.4 KiB
Python
Raw Normal View History

2024-03-26 14:29:53 +00:00
import os
import platform
2024-03-26 12:42:30 +00:00
import discord
2024-03-26 14:29:53 +00:00
import psutil
from discord.ext import bridge
2024-03-26 14:29:53 +00:00
2024-03-26 12:42:30 +00:00
from lib import metadata
from lib.constants import CONST
from lib.embed_builder import EmbedBuilder
2024-06-20 10:34:03 +00:00
from services.currency_service import Currency
2024-06-20 17:48:49 +00:00
from services.stats_service import BlackJackStats
2024-03-26 12:42:30 +00:00
async def cmd(self, ctx: bridge.Context, unix_timestamp: int) -> None:
memory_usage_in_mb: float = psutil.Process().memory_info().rss / (1024 * 1024)
total_rows: str = Currency.format(BlackJackStats.get_total_rows_count())
2024-07-17 11:47:26 +00:00
description: str = "".join(
[
CONST.STRINGS["info_uptime"].format(unix_timestamp),
CONST.STRINGS["info_latency"].format(round(1000 * self.client.latency)),
CONST.STRINGS["info_memory"].format(memory_usage_in_mb),
CONST.STRINGS["info_system"].format(platform.system(), os.name),
CONST.STRINGS["info_api_version"].format(discord.__version__),
CONST.STRINGS["info_database_records"].format(total_rows),
],
)
embed: discord.Embed = EmbedBuilder.create_success_embed(
ctx,
description=description,
footer_text=CONST.STRINGS["info_service_footer"],
show_name=False,
2024-03-26 12:42:30 +00:00
)
embed.set_author(
name=f"{metadata.__title__} v{metadata.__version__}",
url=CONST.REPO_URL,
icon_url=CONST.CHECK_ICON,
)
embed.set_thumbnail(url=CONST.LUMI_LOGO_OPAQUE)
2024-03-26 12:42:30 +00:00
2024-06-21 19:36:59 +00:00
await ctx.respond(embed=embed)