make retrieve of salon in mattermost file
This commit is contained in:
parent
1728ba1303
commit
1ac723d6d5
1 changed files with 2 additions and 13 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Reference in a new issue