#![allow(clippy::print_stdout)]
use std::env;
use blooio::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = env::var("BLOOIO_API_KEY").unwrap_or_else(|_| "sk_demo_key".into());
let chat_id = env::var("CHAT_ID").unwrap_or_else(|_| "chat_demo".into());
let client = Client::new(api_key)?;
let me = client.account().get().await?;
println!("authenticated as user {:?}", me.user_id);
let chat = client.chat(chat_id);
let sent = chat.send_text("hello from the blooio rust client").await?;
println!("sent message ids: {:?}", sent.ids());
Ok(())
}