added ram details

This commit is contained in:
ctih1 2025-07-26 14:05:57 +03:00
parent 7b951b5597
commit 6acb1f68d3
3 changed files with 29 additions and 1 deletions

View file

@ -122,6 +122,12 @@ class BaseCommands(commands.Cog):
memory_file: str = settings["bot"]["active_memory"]
file_size: int = os.path.getsize(memory_file)
memory_info = psutil.virtual_memory() # type: ignore
total_memory = memory_info.total / (1024**3)
used_memory = memory_info.used / (1024**3)
free_memory = memory_info.available / (1024**3)
with open(memory_file, "r") as file:
line_count: int = sum(1 for _ in file)
@ -136,6 +142,11 @@ class BaseCommands(commands.Cog):
inline=False,
)
embed.add_field(
name=k.memory_embed_field(),
value=k.memory_usage(used=used_memory, total=total_memory, percent=round(used_memory/total_memory * 100))
)
with open(settings["splash_text_loc"], "r") as f:
splash_text = "".join(f.readlines())

View file

@ -137,6 +137,7 @@
"markov_model_not_found": "Markov model not found!",
"blacklisted": "blacklisted",
"blacklisted_user": "Blacklisted user",
"edit_fail": "Failed to edit message"
"edit_fail": "Failed to edit message",
"memory_embed_field": "RAM details"
}