1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-23 01:54:22 +00:00

Create inline bot skeleton

This commit is contained in:
Steffo 2022-07-31 08:41:42 +02:00
parent 47de75f702
commit 2c2a7ffc07
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,5 +1,23 @@
use teloxide::prelude::*;
use teloxide::types::*;
use log::*;
mod data; mod data;
fn main() {
println!("Hello, world!"); #[tokio::main]
async fn main() {
pretty_env_logger::init();
info!("patched-porobot is starting...");
let bot = Bot::from_env().auto_send();
let handler = Update::filter_inline_query().branch(dptree::endpoint(|query: InlineQuery, bot: AutoSend<Bot>| async move {
let result = InlineQueryResult::Article(InlineQueryResultArticle::new("test", "Test", InputMessageContent::Text(InputMessageContentText::new("Qui è dove metterei la mia carta, se solo ne avessi una!"))));
let response = bot.answer_inline_query(&query.id, vec![result]).await;
respond(())
}));
Dispatcher::builder(bot, handler).enable_ctrlc_handler().build().dispatch().await;
} }