fix: better info on the servers

This commit is contained in:
silver 2024-06-03 05:01:23 +01:00
parent 55b2e534d4
commit acb6432129

View file

@ -234,12 +234,21 @@ pub(crate) mod server {
};
let config = config_lock.read().await;
let mut result = "|ID|Online|Name|Description|\n|:---|:---|:---|:---|".to_string();
let mut result = "Server Information:\n".to_string();
for server in get_minecraft_config_server(&db, g_id).await {
if let Some(x) = server_information(&server.minecraft, &config.discord_minecraft).await {
result.push_str(&format!(
"\n|{}|{}|{}|{}|",
&x.attributes.identifier, !x.attributes.is_suspended, &x.attributes.name, &x.attributes.description
r#"
Name: {name}
ID: {id}
Online: {online}
Info: {description}
Link: <http://panel.games.skynet.ie/server/{id}>
"#,
name = &x.attributes.name,
online = !x.attributes.is_suspended,
description = &x.attributes.description,
id = &x.attributes.identifier
));
}
}