diff --git a/src/discord.rs b/src/discord.rs index dac7d75..dea7dd6 100644 --- a/src/discord.rs +++ b/src/discord.rs @@ -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 async fn envoie_msg_mattermost(msg: Message) { let infos: &InformationsBot; unsafe { infos = recuperation_info(); } + let salon = infos.recuperation_salon(); let res = infos .recuperation_api() .await @@ -210,7 +199,7 @@ async fn envoie_msg_mattermost(msg: Message) { Some( &json!( // d'après la documentation : https://api.mattermost.com/#tag/WebSocket { - "channel_id": recuperation_salon(), + "channel_id": salon, "message": msg } )