Improve formatting in embeds
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 34s

This commit is contained in:
2025-09-28 17:10:03 +00:00
parent 4b400fea1f
commit ca9e88f1e2

View File

@@ -760,9 +760,9 @@ class PterodactylBot(commands.Bot):
embed.add_field(name="🆔 Server ID", value=f"`{identifier}`", inline=True)
if is_suspended:
embed.add_field(name=" Status", value="⛔ Suspended", inline=True)
embed.add_field(name=" Status", value="`Suspended`", inline=True)
else:
embed.add_field(name=" Status", value="✅ Active", inline=True)
embed.add_field(name=" Status", value="`Active`", inline=True)
# Add resource usage if server is running
if current_state.lower() == "running":
@@ -793,19 +793,19 @@ class PterodactylBot(commands.Bot):
if uptime_ms > 0:
uptime_seconds = uptime_ms // 1000 # Convert ms to seconds
if uptime_seconds < 60:
uptime_text = f"{uptime_seconds}s"
uptime_text = f"`{uptime_seconds}s`"
elif uptime_seconds < 3600:
uptime_text = f"{uptime_seconds // 60}m {uptime_seconds % 60}s"
uptime_text = f"`{uptime_seconds // 60}m {uptime_seconds % 60}s`"
elif uptime_seconds < 86400:
hours = uptime_seconds // 3600
minutes = (uptime_seconds % 3600) // 60
uptime_text = f"{hours}h {minutes}m"
uptime_text = f"`{hours}h {minutes}m`"
else:
days = uptime_seconds // 86400
hours = (uptime_seconds % 86400) // 3600
uptime_text = f"{days}d {hours}h"
uptime_text = f"`{days}d {hours}h`"
else:
uptime_text = "Just started"
uptime_text = "`Just started`"
embed.add_field(name="⏱️ Uptime", value=uptime_text, inline=True)
@@ -825,9 +825,15 @@ class PterodactylBot(commands.Bot):
)
embed.add_field(
name="🌐 Network",
value=f"⬇️ {network_rx} MiB / ⬆️ {network_tx} MiB",
inline=False
name="Network In",
value=f"📥 `{network_rx} MiB`",
inline=True
)
embed.add_field(
name="Network Out",
value=f"📤 `{network_tx} MiB`",
inline=True
)
# Add graph images if available
@@ -835,10 +841,15 @@ class PterodactylBot(commands.Bot):
if server_graphs and server_graphs.has_sufficient_data:
summary = server_graphs.get_data_summary()
graph_description = (
f">>> `Data points: {summary['point_count']}/6`\n"
f"`CPU trend: {summary['cpu_trend']} • Memory trend: {summary['memory_trend']}`"
)
# Add a field explaining the graphs
embed.add_field(
name="📈 Usage Trends (Last Minute)",
value=f"Data points: {summary['point_count']}/6 • CPU trend: {summary['cpu_trend']} • Memory trend: {summary['memory_trend']}",
value=graph_description,
inline=False
)