ssbbot/examples/basic.rs

24 lines
596 B
Rust

use std::process;
use ssbbot::{SsbBot, Keystore};
use ssbbot::error::SsbBotError;
async fn run() -> Result<(), SsbBotError> {
println!("helloooo world");
let mut sbot = SsbBot::init(Keystore::Patchwork, None, None).await?;
sbot.listen_for_message("hello").await?;
Ok(())
}
// Enable an async main function and execute the `run()` function,
// catching any errors and printing them to `stderr` before exiting the
// process.
#[async_std::main]
async fn main() {
if let Err(e) = run().await {
eprintln!("Application error: {}", e);
process::exit(1);
}
}