A Rust api client for Trovo.
Currently supports connecting to chat, sending messages, and looking up users via username, more will be added as the crate develops.
Find a user by username and then connect to their chat.
```rust use futures::prelude::*; use std::{env, error::Error}; use trovo::ClientId;
async fn main() -> Result<(), Box
let client = trovo::Client::new(ClientId::new(client_id));
println!("looking up user '{}'", username);
let user = client
.user(username)
.await?
.expect("no user found for the given username");
println!("found user {:#?}", user);
let mut messages = client.chat_messages_for_channel(&user.channel_id).await?;
println!("listening for chat messages");
while let Some(msg) = messages.next().await {
let msg = msg?;
println!("[{}] {}", msg.nick_name, msg.content);
}
Ok(())
} ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.