From 86f5bb9301a169d7b8d22c3165b05db4727415e5 Mon Sep 17 00:00:00 2001 From: Paweł Dybiec Date: Sat, 24 Dec 2022 00:22:21 +0000 Subject: Initial commit --- src/main.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..d4f30c4 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,17 @@ +mod mattermost; + +use tokio::{self}; +use tracing::{debug, info}; + +#[tokio::main(worker_threads = 2)] + +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + let login = std::env::var("USER_MAIL")?; + let password = std::env::var("USER_PASSWORD")?; + let auth = mattermost::AuthData { login, password }; + let mut client = mattermost::Client::new(auth, "https://mattermost.continuum.ii.uni.wroc.pl"); + client.update_bearer_token().await?; + client.handle_websocket_stream().await?; + Ok(()) +} -- cgit 1.4.1