Added shitty 3rd option
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -7,7 +7,7 @@ use telegram_bot::*;
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
dotenv().ok();
|
||||
|
||||
|
||||
let token = env::var("TELEGRAM_BOT_TOKEN").expect("TELEGRAM_BOT_TOKEN not set");
|
||||
let api = Api::new(token);
|
||||
|
||||
@@ -22,6 +22,7 @@ async fn main() {
|
||||
if let UpdateKind::InlineQuery(query) = update.kind {
|
||||
let mut option1 = String::new();
|
||||
let mut option2 = String::new();
|
||||
let mut option3 = String::new();
|
||||
if query.query == "" {
|
||||
api.send(query.answer(vec![])).await.ok();
|
||||
continue;
|
||||
@@ -37,7 +38,10 @@ async fn main() {
|
||||
option1.push(letter.to_lowercase().next().unwrap());
|
||||
option2.push(letter.to_uppercase().next().unwrap());
|
||||
}
|
||||
option3.push(letter);
|
||||
option3.push(' ');
|
||||
}
|
||||
option3.pop();
|
||||
}
|
||||
|
||||
api.send(query.answer(vec![
|
||||
@@ -55,6 +59,13 @@ async fn main() {
|
||||
disable_web_page_preview: false,
|
||||
}
|
||||
).into(),
|
||||
InlineQueryResultArticle::new(
|
||||
"3", option3.clone(), InputTextMessageContent {
|
||||
message_text: option3,
|
||||
parse_mode: None,
|
||||
disable_web_page_preview: false,
|
||||
}
|
||||
).into(),
|
||||
])).await.ok();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user