From 7db222ace735869fdc84943af48b46a7d8be397a Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Fri, 6 Aug 2021 00:51:09 +0600 Subject: [PATCH 01/13] Add more community bots --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6e2a1a86..18fc8eec 100644 --- a/README.md +++ b/README.md @@ -424,6 +424,8 @@ Feel free to propose your own bot to our collection! - [msfjarvis/walls-bot-rs](https://github.com/msfjarvis/walls-bot-rs) -- Telegram bot for my wallpapers collection, in Rust. - [MustafaSalih1993/Miss-Vodka-Telegram-Bot](https://github.com/MustafaSalih1993/Miss-Vodka-Telegram-Bot) -- A telegram bot written in rust using "Teloxide" library. - [x13a/tg-prompt](https://github.com/x13a/tg-prompt) -- Telegram prompt. + - [magnickolas/remindee-bot](https://github.com/magnickolas/remindee-bot) -- Reminder bot for Telegram without bullshit. + - [perosar/perorustbot](https://github.com/perosar/perorustbot) -- My personal telegram bot in rust. ## Contributing See [CONRIBUTING.md](https://github.com/teloxide/teloxide/blob/master/CONTRIBUTING.md). From ea5b2df25158b4e8cfb6f0fc0e97a8c653b9dd68 Mon Sep 17 00:00:00 2001 From: Colin Diener Date: Wed, 18 Aug 2021 21:54:32 -0700 Subject: [PATCH 02/13] Include inline bot example --- examples/inline_bot/Cargo.toml | 14 +++++++ examples/inline_bot/src/main.rs | 73 +++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 examples/inline_bot/Cargo.toml create mode 100644 examples/inline_bot/src/main.rs diff --git a/examples/inline_bot/Cargo.toml b/examples/inline_bot/Cargo.toml new file mode 100644 index 00000000..40e7281d --- /dev/null +++ b/examples/inline_bot/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "inline_bot" +version = "0.1.0" +authors = ["Colin Diener "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +teloxide = { path = "../../", features = ["macros", "auto-send"] } +log = "0.4.8" +pretty_env_logger = "0.4.0" +tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] } +tokio-stream = "0.1.3" diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs new file mode 100644 index 00000000..fc919b3c --- /dev/null +++ b/examples/inline_bot/src/main.rs @@ -0,0 +1,73 @@ +use teloxide::{Bot, payloads::AnswerInlineQuery, prelude::*, types::{InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText}}; +use tokio_stream::wrappers::UnboundedReceiverStream; + +#[tokio::main] +async fn main() { + run().await; +} + +async fn run() { + let bot = Bot::from_env(); + // Create a new dispatcher to handle incoming messages + let dp = Dispatcher::new(bot); + dp.inline_queries_handler(|rx: DispatcherHandlerRx| { + UnboundedReceiverStream::new(rx).for_each_concurrent(None, |msg| async move { + // First, create your actual response + let google_search = InlineQueryResultArticle::new( + // Each item needs a unique ID, as well as the response container for the items. + // These can be whatever, as long as they don't conflict. + "01".to_string(), + // What the user will actually see + "Google Search", + // What message will send when clicked/tapped + InputMessageContent::Text(InputMessageContentText::new(format!( + "https://www.google.com/search?q={}", + msg.update.query, + ))), + ); + // You can also construct them from the struct itself, if you want a little more control. + // Please refer to the documentation for more detailed information about each field. + // https://docs.rs/teloxide/0.5.1/teloxide/types/struct.InlineQueryResultArticle.html + let ddg_search = InlineQueryResultArticle { + id: "02".to_string(), // again, anything -- as long as it's unique in this context + title: "DuckDuckGo Search".to_string(), + input_message_content: InputMessageContent::Text(InputMessageContentText::new( + format!("https://duckduckgo.com/?q={}", msg.update.query.to_string()), + )), + reply_markup: None, + url: Some("https://duckduckgo.com/about".to_string()), // Note: This is the url that will open if they click the thumbnail + hide_url: None, + description: Some("DuckDuckGo Search".to_string()), + thumb_url: Some( + "https://duckduckgo.com/assets/logo_header.v108.png".to_string(), + ), + thumb_width: Some(64), + thumb_height: Some(64), + }; + + // Now put those responses into a "Result" + // https://docs.rs/teloxide/0.5.1/teloxide/payloads/struct.AnswerInlineQuery.html + let all_results = AnswerInlineQuery { + inline_query_id: "03".to_string(), // again, anything -- as long as it's unique in this context + results: vec![InlineQueryResult::Article(google_search), InlineQueryResult::Article(ddg_search)], + cache_time: None, + is_personal: None, + next_offset: None, + switch_pm_text: None, + switch_pm_parameter: None, + }; + + // Send it off! One thing to note -- the ID we use here must be of the message we're responding to. + let response = msg + .requester + .answer_inline_query(msg.update.id.to_string(), all_results.results) + .send() + .await; + if response.is_err() { + dbg!(response); + } + }) + }) + .dispatch() + .await; +} From a2bfdf850aeb56d36e0f7adea804a25bb884a5c7 Mon Sep 17 00:00:00 2001 From: Waffle Date: Thu, 19 Aug 2021 12:03:35 +0300 Subject: [PATCH 03/13] Suppress clippy false positive --- src/dispatching/dialogue/storage/redis_storage.rs | 2 ++ src/dispatching/dispatcher.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/dispatching/dialogue/storage/redis_storage.rs b/src/dispatching/dialogue/storage/redis_storage.rs index 5e2eb843..f3889acc 100644 --- a/src/dispatching/dialogue/storage/redis_storage.rs +++ b/src/dispatching/dialogue/storage/redis_storage.rs @@ -66,6 +66,8 @@ where .await?; if let redis::Value::Bulk(values) = deleted_rows_count { + // False positive + #[allow(clippy::collapsible_match)] if let redis::Value::Int(deleted_rows_count) = values[0] { match deleted_rows_count { 0 => return Err(RedisStorageError::DialogueNotFound), diff --git a/src/dispatching/dispatcher.rs b/src/dispatching/dispatcher.rs index d0cadeff..77133764 100644 --- a/src/dispatching/dispatcher.rs +++ b/src/dispatching/dispatcher.rs @@ -311,6 +311,8 @@ where tokio::pin!(stream); loop { + // False positive + #[allow(clippy::collapsible_match)] if let Ok(upd) = timeout(shutdown_check_timeout, stream.next()).await { match upd { None => break, From 93c8e00086030aca6426fa57ea815edce7e4d3c9 Mon Sep 17 00:00:00 2001 From: Colin Diener Date: Thu, 19 Aug 2021 10:56:39 -0700 Subject: [PATCH 04/13] Remove unused dispatcher variable, Bot to AutoSend --- examples/inline_bot/src/main.rs | 130 +++++++++++++++++--------------- 1 file changed, 70 insertions(+), 60 deletions(-) diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs index fc919b3c..ab15b82c 100644 --- a/examples/inline_bot/src/main.rs +++ b/examples/inline_bot/src/main.rs @@ -1,4 +1,11 @@ -use teloxide::{Bot, payloads::AnswerInlineQuery, prelude::*, types::{InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText}}; +use teloxide::{ + payloads::AnswerInlineQuery, + prelude::*, + types::{ + InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText, + }, + Bot, +}; use tokio_stream::wrappers::UnboundedReceiverStream; #[tokio::main] @@ -7,67 +14,70 @@ async fn main() { } async fn run() { - let bot = Bot::from_env(); + let bot = Bot::from_env().auto_send(); // Create a new dispatcher to handle incoming messages - let dp = Dispatcher::new(bot); - dp.inline_queries_handler(|rx: DispatcherHandlerRx| { - UnboundedReceiverStream::new(rx).for_each_concurrent(None, |msg| async move { - // First, create your actual response - let google_search = InlineQueryResultArticle::new( - // Each item needs a unique ID, as well as the response container for the items. - // These can be whatever, as long as they don't conflict. - "01".to_string(), - // What the user will actually see - "Google Search", - // What message will send when clicked/tapped - InputMessageContent::Text(InputMessageContentText::new(format!( - "https://www.google.com/search?q={}", - msg.update.query, - ))), - ); - // You can also construct them from the struct itself, if you want a little more control. - // Please refer to the documentation for more detailed information about each field. - // https://docs.rs/teloxide/0.5.1/teloxide/types/struct.InlineQueryResultArticle.html - let ddg_search = InlineQueryResultArticle { - id: "02".to_string(), // again, anything -- as long as it's unique in this context - title: "DuckDuckGo Search".to_string(), - input_message_content: InputMessageContent::Text(InputMessageContentText::new( - format!("https://duckduckgo.com/?q={}", msg.update.query.to_string()), - )), - reply_markup: None, - url: Some("https://duckduckgo.com/about".to_string()), // Note: This is the url that will open if they click the thumbnail - hide_url: None, - description: Some("DuckDuckGo Search".to_string()), - thumb_url: Some( - "https://duckduckgo.com/assets/logo_header.v108.png".to_string(), - ), - thumb_width: Some(64), - thumb_height: Some(64), - }; + Dispatcher::new(bot) + .inline_queries_handler(|rx: DispatcherHandlerRx, InlineQuery>| { + UnboundedReceiverStream::new(rx).for_each_concurrent(None, |msg| async move { + // First, create your actual response + let google_search = InlineQueryResultArticle::new( + // Each item needs a unique ID, as well as the response container for the items. + // These can be whatever, as long as they don't conflict. + "01".to_string(), + // What the user will actually see + "Google Search", + // What message will send when clicked/tapped + InputMessageContent::Text(InputMessageContentText::new(format!( + "https://www.google.com/search?q={}", + msg.update.query, + ))), + ); + // You can also construct them from the struct itself, if you want a little more control. + // Please refer to the documentation for more detailed information about each field. + // https://docs.rs/teloxide/0.5.1/teloxide/types/struct.InlineQueryResultArticle.html + let ddg_search = InlineQueryResultArticle { + id: "02".to_string(), // again, anything -- as long as it's unique in this context + title: "DuckDuckGo Search".to_string(), + input_message_content: InputMessageContent::Text(InputMessageContentText::new( + format!("https://duckduckgo.com/?q={}", msg.update.query.to_string()), + )), + reply_markup: None, + url: Some("https://duckduckgo.com/about".to_string()), // Note: This is the url that will open if they click the thumbnail + hide_url: None, + description: Some("DuckDuckGo Search".to_string()), + thumb_url: Some( + "https://duckduckgo.com/assets/logo_header.v108.png".to_string(), + ), + thumb_width: Some(64), + thumb_height: Some(64), + }; - // Now put those responses into a "Result" - // https://docs.rs/teloxide/0.5.1/teloxide/payloads/struct.AnswerInlineQuery.html - let all_results = AnswerInlineQuery { - inline_query_id: "03".to_string(), // again, anything -- as long as it's unique in this context - results: vec![InlineQueryResult::Article(google_search), InlineQueryResult::Article(ddg_search)], - cache_time: None, - is_personal: None, - next_offset: None, - switch_pm_text: None, - switch_pm_parameter: None, - }; + // Now put those responses into a "Result" + // https://docs.rs/teloxide/0.5.1/teloxide/payloads/struct.AnswerInlineQuery.html + let all_results = AnswerInlineQuery { + inline_query_id: "03".to_string(), // again, anything -- as long as it's unique in this context + results: vec![ + InlineQueryResult::Article(google_search), + InlineQueryResult::Article(ddg_search), + ], + cache_time: None, + is_personal: None, + next_offset: None, + switch_pm_text: None, + switch_pm_parameter: None, + }; - // Send it off! One thing to note -- the ID we use here must be of the message we're responding to. - let response = msg - .requester - .answer_inline_query(msg.update.id.to_string(), all_results.results) - .send() - .await; - if response.is_err() { - dbg!(response); - } + // Send it off! One thing to note -- the ID we use here must be of the message we're responding to. + let response = msg + .requester + .answer_inline_query(msg.update.id.to_string(), all_results.results) + .send() + .await; + if response.is_err() { + dbg!(response); + } + }) }) - }) - .dispatch() - .await; + .dispatch() + .await; } From f6ad066087bac65d60f4ee58cae45193f9533bc8 Mon Sep 17 00:00:00 2001 From: Colin Diener Date: Thu, 19 Aug 2021 11:00:58 -0700 Subject: [PATCH 05/13] Clarify verbage from message to query --- examples/inline_bot/src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs index ab15b82c..d8437c01 100644 --- a/examples/inline_bot/src/main.rs +++ b/examples/inline_bot/src/main.rs @@ -15,10 +15,10 @@ async fn main() { async fn run() { let bot = Bot::from_env().auto_send(); - // Create a new dispatcher to handle incoming messages + // Create a new dispatcher to handle incoming queries Dispatcher::new(bot) .inline_queries_handler(|rx: DispatcherHandlerRx, InlineQuery>| { - UnboundedReceiverStream::new(rx).for_each_concurrent(None, |msg| async move { + UnboundedReceiverStream::new(rx).for_each_concurrent(None, |query| async move { // First, create your actual response let google_search = InlineQueryResultArticle::new( // Each item needs a unique ID, as well as the response container for the items. @@ -26,10 +26,10 @@ async fn run() { "01".to_string(), // What the user will actually see "Google Search", - // What message will send when clicked/tapped + // What message will be sent when clicked/tapped InputMessageContent::Text(InputMessageContentText::new(format!( "https://www.google.com/search?q={}", - msg.update.query, + query.update.query, ))), ); // You can also construct them from the struct itself, if you want a little more control. @@ -39,7 +39,7 @@ async fn run() { id: "02".to_string(), // again, anything -- as long as it's unique in this context title: "DuckDuckGo Search".to_string(), input_message_content: InputMessageContent::Text(InputMessageContentText::new( - format!("https://duckduckgo.com/?q={}", msg.update.query.to_string()), + format!("https://duckduckgo.com/?q={}", query.update.query.to_string()), )), reply_markup: None, url: Some("https://duckduckgo.com/about".to_string()), // Note: This is the url that will open if they click the thumbnail @@ -67,10 +67,10 @@ async fn run() { switch_pm_parameter: None, }; - // Send it off! One thing to note -- the ID we use here must be of the message we're responding to. - let response = msg + // Send it off! One thing to note -- the ID we use here must be of the query we're responding to. + let response = query .requester - .answer_inline_query(msg.update.id.to_string(), all_results.results) + .answer_inline_query(query.update.id.to_string(), all_results.results) .send() .await; if response.is_err() { From 43f8e73973b4300740c3d61c3c8f4e59f43b22c4 Mon Sep 17 00:00:00 2001 From: Colin Diener Date: Thu, 19 Aug 2021 11:03:53 -0700 Subject: [PATCH 06/13] Remove superfluous struct --- examples/inline_bot/src/main.rs | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs index d8437c01..0a6b1d49 100644 --- a/examples/inline_bot/src/main.rs +++ b/examples/inline_bot/src/main.rs @@ -1,5 +1,4 @@ use teloxide::{ - payloads::AnswerInlineQuery, prelude::*, types::{ InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText, @@ -52,27 +51,13 @@ async fn run() { thumb_height: Some(64), }; - // Now put those responses into a "Result" - // https://docs.rs/teloxide/0.5.1/teloxide/payloads/struct.AnswerInlineQuery.html - let all_results = AnswerInlineQuery { - inline_query_id: "03".to_string(), // again, anything -- as long as it's unique in this context - results: vec![ - InlineQueryResult::Article(google_search), - InlineQueryResult::Article(ddg_search), - ], - cache_time: None, - is_personal: None, - next_offset: None, - switch_pm_text: None, - switch_pm_parameter: None, - }; - + let results = vec![ + InlineQueryResult::Article(google_search), + InlineQueryResult::Article(ddg_search), + ]; // Send it off! One thing to note -- the ID we use here must be of the query we're responding to. - let response = query - .requester - .answer_inline_query(query.update.id.to_string(), all_results.results) - .send() - .await; + let response = + query.requester.answer_inline_query(&query.update.id, results).send().await; if response.is_err() { dbg!(response); } From 1bd47314bee1e6812f066e026bd0a069f382d06b Mon Sep 17 00:00:00 2001 From: Colin Diener Date: Thu, 19 Aug 2021 11:05:56 -0700 Subject: [PATCH 07/13] Remove dbg! macro in favour of log::error! macro --- examples/inline_bot/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs index 0a6b1d49..cd542eff 100644 --- a/examples/inline_bot/src/main.rs +++ b/examples/inline_bot/src/main.rs @@ -58,8 +58,8 @@ async fn run() { // Send it off! One thing to note -- the ID we use here must be of the query we're responding to. let response = query.requester.answer_inline_query(&query.update.id, results).send().await; - if response.is_err() { - dbg!(response); + if let Err(err) = response { + log::error!("Error in handler: {:?}", err); } }) }) From f5a7187295969237d30ce7876828326e6f685b00 Mon Sep 17 00:00:00 2001 From: Colin Diener Date: Thu, 19 Aug 2021 11:23:57 -0700 Subject: [PATCH 08/13] Apply builder-pattern to second example result --- examples/inline_bot/src/main.rs | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs index cd542eff..927679e8 100644 --- a/examples/inline_bot/src/main.rs +++ b/examples/inline_bot/src/main.rs @@ -31,30 +31,27 @@ async fn run() { query.update.query, ))), ); - // You can also construct them from the struct itself, if you want a little more control. + // While constructing them from the struct itself is possible, it is preferred to use + // the builder pattern if you wish to add more information to your result. // Please refer to the documentation for more detailed information about each field. // https://docs.rs/teloxide/0.5.1/teloxide/types/struct.InlineQueryResultArticle.html - let ddg_search = InlineQueryResultArticle { - id: "02".to_string(), // again, anything -- as long as it's unique in this context - title: "DuckDuckGo Search".to_string(), - input_message_content: InputMessageContent::Text(InputMessageContentText::new( - format!("https://duckduckgo.com/?q={}", query.update.query.to_string()), - )), - reply_markup: None, - url: Some("https://duckduckgo.com/about".to_string()), // Note: This is the url that will open if they click the thumbnail - hide_url: None, - description: Some("DuckDuckGo Search".to_string()), - thumb_url: Some( - "https://duckduckgo.com/assets/logo_header.v108.png".to_string(), - ), - thumb_width: Some(64), - thumb_height: Some(64), - }; + let ddg_search = InlineQueryResultArticle::new( + "02".to_string(), + "DuckDuckGo Search".to_string(), + InputMessageContent::Text(InputMessageContentText::new(format!( + "https://duckduckgo.com/?q={}", + query.update.query.to_string() + ))), + ) + .description("DuckDuckGo Search") + .thumb_url("https://duckduckgo.com/assets/logo_header.v108.png") + .url("https://duckduckgo.com/about"); // Note: This is the url that will open if they click the thumbnail let results = vec![ InlineQueryResult::Article(google_search), InlineQueryResult::Article(ddg_search), ]; + // Send it off! One thing to note -- the ID we use here must be of the query we're responding to. let response = query.requester.answer_inline_query(&query.update.id, results).send().await; From d3906476e960b7044b76bab924f61e7ef2bc56a5 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 20 Aug 2021 01:32:55 +0300 Subject: [PATCH 09/13] Add WaffleLapkin/crate_upd_bot to `Community bots` list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6e2a1a86..9b7e03ea 100644 --- a/README.md +++ b/README.md @@ -411,6 +411,7 @@ A: Yes. You can setup any logger, for example, [fern], e.g. teloxide has no spec ## Community bots Feel free to propose your own bot to our collection! + - [WaffleLapkin/crate_upd_bot](https://github.com/WaffleLapkin/crate_upd_bot) -- A bot that notifies about crate updates. - [dracarys18/grpmr-rs](https://github.com/dracarys18/grpmr-rs) -- A telegram group manager bot with variety of extra features. - [steadylearner/subreddit_reader](https://github.com/steadylearner/Rust-Full-Stack/tree/master/commits/teloxide/subreddit_reader) -- A bot that shows the latest posts at Rust subreddit. - [ArtHome12/vzmuinebot](https://github.com/ArtHome12/vzmuinebot) -- Telegram bot for food menu navigate. From d8a8648911127de9b2ea78398d1b858f147f7624 Mon Sep 17 00:00:00 2001 From: Cyber Knight Date: Fri, 20 Aug 2021 13:24:24 +0800 Subject: [PATCH 10/13] Add cyberknight777/knight-bot to community bots Signed-off-by: Cyber Knight --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6e2a1a86..71a8239e 100644 --- a/README.md +++ b/README.md @@ -424,6 +424,7 @@ Feel free to propose your own bot to our collection! - [msfjarvis/walls-bot-rs](https://github.com/msfjarvis/walls-bot-rs) -- Telegram bot for my wallpapers collection, in Rust. - [MustafaSalih1993/Miss-Vodka-Telegram-Bot](https://github.com/MustafaSalih1993/Miss-Vodka-Telegram-Bot) -- A telegram bot written in rust using "Teloxide" library. - [x13a/tg-prompt](https://github.com/x13a/tg-prompt) -- Telegram prompt. + - [cyberknight777/knight-bot](https://gitlab.com/cyberknight777/knight-bot) -- A telegram bot with variety of fun features. ## Contributing See [CONRIBUTING.md](https://github.com/teloxide/teloxide/blob/master/CONTRIBUTING.md). From e2db85e1623640fe2e230c632110d542984e4fb3 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Sun, 22 Aug 2021 11:37:16 +0600 Subject: [PATCH 11/13] Paraphrase magnickolas/remindee-bot --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 18fc8eec..28da6d40 100644 --- a/README.md +++ b/README.md @@ -424,8 +424,7 @@ Feel free to propose your own bot to our collection! - [msfjarvis/walls-bot-rs](https://github.com/msfjarvis/walls-bot-rs) -- Telegram bot for my wallpapers collection, in Rust. - [MustafaSalih1993/Miss-Vodka-Telegram-Bot](https://github.com/MustafaSalih1993/Miss-Vodka-Telegram-Bot) -- A telegram bot written in rust using "Teloxide" library. - [x13a/tg-prompt](https://github.com/x13a/tg-prompt) -- Telegram prompt. - - [magnickolas/remindee-bot](https://github.com/magnickolas/remindee-bot) -- Reminder bot for Telegram without bullshit. - - [perosar/perorustbot](https://github.com/perosar/perorustbot) -- My personal telegram bot in rust. + - [magnickolas/remindee-bot](https://github.com/magnickolas/remindee-bot) -- Telegram bot for managing reminders. ## Contributing See [CONRIBUTING.md](https://github.com/teloxide/teloxide/blob/master/CONTRIBUTING.md). From 5e260d0afc0a49a20210bbf595c5e8b11b6aab04 Mon Sep 17 00:00:00 2001 From: Waffle Date: Wed, 25 Aug 2021 18:12:14 +0300 Subject: [PATCH 12/13] Depend on a right `futures` version --- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3a0be3e..a5fee453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +### Fixed + +- Depend on a right `futures` version + ## [0.5.1] - 2021-08-05 ### Changed diff --git a/Cargo.toml b/Cargo.toml index aee35fcc..fef3c0e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,7 @@ mime = "0.3" derive_more = "0.99" thiserror = "1.0" async-trait = "0.1" -futures = "0.3" +futures = "0.3.15" pin-project = "1.0" serde_with_macros = "1.4" From 2a6067fe94773a0015627a6aaa1930b8f88b6da0 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Wed, 25 Aug 2021 23:51:19 +0600 Subject: [PATCH 13/13] Prepare for v0.5.2 --- CHANGELOG.md | 4 +++- Cargo.toml | 2 +- examples/inline_bot/src/main.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5fee453..09047ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [0.5.2] - 2021-08-25 + ### Fixed -- Depend on a right `futures` version +- Depend on a correct `futures` version (v0.3.15). ## [0.5.1] - 2021-08-05 diff --git a/Cargo.toml b/Cargo.toml index fef3c0e6..193a570b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "teloxide" -version = "0.5.1" +version = "0.5.2" edition = "2018" description = "An elegant Telegram bots framework for Rust" repository = "https://github.com/teloxide/teloxide" diff --git a/examples/inline_bot/src/main.rs b/examples/inline_bot/src/main.rs index 927679e8..d7c10399 100644 --- a/examples/inline_bot/src/main.rs +++ b/examples/inline_bot/src/main.rs @@ -34,7 +34,7 @@ async fn run() { // While constructing them from the struct itself is possible, it is preferred to use // the builder pattern if you wish to add more information to your result. // Please refer to the documentation for more detailed information about each field. - // https://docs.rs/teloxide/0.5.1/teloxide/types/struct.InlineQueryResultArticle.html + // https://docs.rs/teloxide/latest/teloxide/types/struct.InlineQueryResultArticle.html let ddg_search = InlineQueryResultArticle::new( "02".to_string(), "DuckDuckGo Search".to_string(),