From b099674fef360f9cc49fd1c98d3fe1e27a4993a8 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 5 Jan 2022 01:37:20 +0100 Subject: [PATCH] send message --- src/discord.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/discord.rs b/src/discord.rs index dea7dd6..640931e 100644 --- a/src/discord.rs +++ b/src/discord.rs @@ -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::( "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)); - } - } }