Crates.io | keybase-bot-api |
lib.rs | keybase-bot-api |
version | 0.4.2 |
source | src |
created_at | 2019-09-09 01:23:37.385717 |
updated_at | 2021-10-03 22:49:24.724407 |
description | Write bots for Keybase |
homepage | |
repository | https://github.com/MarcoPolo/keybase-bot-api |
max_upload_size | |
id | 163411 |
size | 47,373 |
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.
Make sure to install Keybase.
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);
}
}
Look at the examples folder for a full list of examples. Run them with cargo like so: cargo run --example read
.