keybase-bot-api 0.4.2

Write bots for Keybase
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use keybase_bot_api::{chat::ChannelParams, Bot, Chat};

fn main() {
    let bot = Bot::new(
        "rustybot",
        option_env!("KEYBASE_PAPERKEY").expect("Missing KEYBASE_PAPERKEY env"),
    )
    .unwrap();
    let channel = ChannelParams {
        name: format!("{},{}", bot.username, "marcopolo,pkt0"),
        ..Default::default()
    };
    let msg = "Hello World";

    if let Err(e) = bot.send_msg(&channel, &msg) {
        println!("Failed to send message: {:?}", e);
    }
}