7 unstable releases

0.4.2 Oct 3, 2021
0.4.1 Sep 25, 2019
0.3.0 Sep 16, 2019
0.2.1 Sep 16, 2019
0.1.0 Sep 9, 2019

#1 in #keybase


Used in 2 crates (via grinbot_keybase_service)

Apache-2.0 OR MIT

19KB
480 lines

Keybase Bot API for Rust

Script Keybase Chat in Rust!

This module is a side-project/work in progress and may change or have crashers, but feel free to play with it. As long as you're logged in as a Keybase user, you can use this module to script basic chat commands.

Prerequisites

Make sure to install Keybase.

Hello world

use keybase_bot_api::{Chat, Bot, chat::ChannelParams};

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

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

More examples

Look at the examples folder for a full list of examples. Run them with cargo like so: cargo run --example read.

Dependencies

~6–18MB
~227K SLoC