Added nodes panel in debug view

This commit is contained in:
Choco
2024-04-20 13:21:20 +08:00
parent abf97b4375
commit d4cb50a067
4 changed files with 234 additions and 24 deletions

View File

@@ -133,6 +133,13 @@ def get_lang_non_async(guild_id: int, *keys) -> Union[list[str], str]:
return LANGS.get(lang, {}).get(keys[0], "Language pack not found!")
return [LANGS.get(lang, {}).get(key, "Language pack not found!") for key in keys]
def format_bytes(bytes: int, unit: bool = False):
if bytes <= 1_000_000_000:
return f"{bytes / (1024 ** 2):.1f}" + ("MB" if unit else "")
else:
return f"{bytes / (1024 ** 3):.1f}" + ("GB" if unit else "")
async def get_lang(guild_id:int, *keys) -> Union[list[str], str]:
settings = await get_settings(guild_id)
lang = settings.get("lang", "EN")