use ferogram::Client;
const API_ID: i32 = 0; const API_HASH: &str = "";
#[tokio::main]
async fn main() {
if let Err(e) = run().await {
eprintln!("error: {e}");
std::process::exit(1);
}
}
async fn run() -> Result<(), Box<dyn std::error::Error>> {
if API_ID == 0 || API_HASH.is_empty() {
eprintln!("Fill in API_ID and API_HASH at the top of hello_self.rs");
std::process::exit(1);
}
let (client, _shutdown) = Client::quick_connect("hello.session", API_ID, API_HASH).await?;
client.send_message("me", "Hello from ferogram!").await?;
println!("Message sent to Saved Messages.");
client.save_session().await?;
Ok(())
}