send message
This commit is contained in:
parent
7ccb1e0dc7
commit
b099674fef
1 changed files with 3 additions and 11 deletions
|
@ -189,31 +189,23 @@ async fn envoie_msg_mattermost(msg: Message) {
|
|||
infos = recuperation_info();
|
||||
}
|
||||
let salon = infos.recuperation_salon();
|
||||
println!("Envoie d'un message de {}!", msg.author);
|
||||
let res = infos
|
||||
.recuperation_api()
|
||||
.await
|
||||
.query::<String>(
|
||||
"POST",
|
||||
"post",
|
||||
"posts",
|
||||
None,
|
||||
Some(
|
||||
&json!( // d'après la documentation : https://api.mattermost.com/#tag/WebSocket
|
||||
{
|
||||
"channel_id": salon,
|
||||
"message": msg
|
||||
"message": msg.content
|
||||
}
|
||||
)
|
||||
.to_string(),
|
||||
),
|
||||
)
|
||||
.await;
|
||||
|
||||
match res {
|
||||
Ok(res) => {
|
||||
println!("{}", res);
|
||||
}
|
||||
Err(e) => {
|
||||
erreur::affiche_message_erreur(&format!("[Discord -> Mattermost] Erreur: {}", e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue