Crates.io | pilot |
lib.rs | pilot |
version | 0.0.7 |
source | src |
created_at | 2021-01-26 06:37:25.657484 |
updated_at | 2021-10-20 02:37:15.729731 |
description | the pilot manipulating telegram bot |
homepage | |
repository | |
max_upload_size | |
id | 346771 |
size | 46,040 |
the pilot manipulating telegram bot
this project is highly WIP, and the name would also be renamed in the later release, please be really deep considering when trying it.
use pilot::{Bot, UpdateMessage, SendMessage};
async fn main() {
let mut bot = Bot::new();
bot.command("ping", |bot, msg| async move {
match msg.as_ref() {
UpdateMessage::Message(msg) => {
let message = SendMessage::new(msg.chat.id.to_string(), "pong");
bot.request(message).await;
}
_ => {}
}
});
bot.polling().await;
}