make retrieve of salon in mattermost file

This commit is contained in:
Mylloon 2022-01-05 01:24:17 +01:00
parent 1728ba1303
commit 1ac723d6d5
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -182,24 +182,13 @@ pub async fn start_discord(
} }
} }
/// Ne peut pas être async (limitation de serde_json)
fn recuperation_salon() -> String {
let infos: &InformationsBot;
unsafe {
infos = recuperation_info();
}
infos.recuperation_salon();
String::from("temp")
}
/// Envoie un message sur Mattermost /// Envoie un message sur Mattermost
async fn envoie_msg_mattermost(msg: Message) { async fn envoie_msg_mattermost(msg: Message) {
let infos: &InformationsBot; let infos: &InformationsBot;
unsafe { unsafe {
infos = recuperation_info(); infos = recuperation_info();
} }
let salon = infos.recuperation_salon();
let res = infos let res = infos
.recuperation_api() .recuperation_api()
.await .await
@ -210,7 +199,7 @@ async fn envoie_msg_mattermost(msg: Message) {
Some( Some(
&json!( // d'après la documentation : https://api.mattermost.com/#tag/WebSocket &json!( // d'après la documentation : https://api.mattermost.com/#tag/WebSocket
{ {
"channel_id": recuperation_salon(), "channel_id": salon,
"message": msg "message": msg
} }
) )