diff --git a/src/bin/bot.rs b/src/bin/bot.rs index 26475dd..88c99a1 100644 --- a/src/bin/bot.rs +++ b/src/bin/bot.rs @@ -2,16 +2,16 @@ use anyhow::Result; use futures::stream::{Stream, StreamExt}; use tokio::sync::mpsc::{channel, Sender}; use tokio_tungstenite::tungstenite::Error as WsError; -use tokio_tungstenite::tungstenite::Message; +use tokio_tungstenite::tungstenite::Message as WsMessage; use slack_client::client::SlackApiClient; use slack_client::events; use slack_client::requests::RtmConnectRequest; use slack_client::responses::RtmConnect; -async fn wait_for_messages(stream: &mut (dyn Stream> + Unpin + Send), tx: &mut Sender) { +async fn wait_for_messages(stream: &mut (dyn Stream> + Unpin + Send), tx: &mut Sender) { while let Some(Ok(message)) = stream.next().await { - if let Message::Text(text) = message { + if let WsMessage::Text(text) = message { if let Ok(msg) = serde_json::from_str::(&text) { let _ = tx.send(msg).await; }