-
Notifications
You must be signed in to change notification settings - Fork 5
Description
So what im doing is very simple. Its trying to get server info from a certain ip and port using this package and when trying to get the motd, i use status.status.description to set it in a mut variable. The problem is that when trying to parse this info to my webhook, nothing works. Ive tried casting it into different variables, and trying to convert the struct to json packages. I have other things like max players and players online working just fine, but this is giving me issues. Is there any way you know to fix this or cast this to a usable variable that i can give to the webhook to print? My Code for this ill be link down below.
let connection = config.connect().await.expect("Invalid Ip");
let status = connection.status().await.expect("No Ping from server");
let client = WebhookClient::new(&url);
//println!("{:#?}", serverImage);
//sends message to the webhook
client.send(|message| message
.username("Eoka Scanner")
.avatar_url(IMAGE_URL)
.embed(|embed| embed
.title(&ip)
.description("description") {this is where the motd is trying to be printed its set to a default text rn because it gives errrors}
//.image(&serverImage.as_str())
.field(&"online/max".replace("online", &onlinePlayers.to_string()).replace("max", &maxPlayers.to_string()), "users matching search", false))).await?;
}
Any possible solutions or insight into my problems would be nice. Any questions you have about this i can answer