blob: d4f30c4b337d3456305308107ca7d5b56c585f32 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
mod mattermost;
use tokio::{self};
use tracing::{debug, info};
#[tokio::main(worker_threads = 2)]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
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(())
}
|