From 9e9f6c199173066afb45c1a8a4691229342f0091 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Fri, 23 Oct 2020 08:18:57 +0600 Subject: [PATCH 1/4] Add LoginUrl::new --- src/types/login_url.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/types/login_url.rs b/src/types/login_url.rs index 5c683df0..0fc65f10 100644 --- a/src/types/login_url.rs +++ b/src/types/login_url.rs @@ -23,6 +23,10 @@ pub struct LoginUrl { } impl LoginUrl { + pub fn new(url: S) -> Self { + Self { url: url.into(), forward_text: None, bot_username: None, request_write_access: None } + } + pub fn url(mut self, val: S) -> Self where S: Into, From 3c04d573f94d527f159b80afb85579d721f2c0e3 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Fri, 23 Oct 2020 08:23:09 +0600 Subject: [PATCH 2/4] Prepare for v0.3.2 --- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- README.md | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deaea888..a43791bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.2] - 2020-10-23 + +### Added + - `LoginUrl::new` ([issue 298](https://github.com/teloxide/teloxide/issues/298)) + ## [0.3.1] - 2020-08-25 ### Added diff --git a/Cargo.toml b/Cargo.toml index dc1562ee..7168293a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "teloxide" -version = "0.3.1" +version = "0.3.2" edition = "2018" description = "An elegant Telegram bots framework for Rust" repository = "https://github.com/teloxide/teloxide" diff --git a/README.md b/README.md index 9dad8c5a..d487a130 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,8 @@ $ rustup override set nightly 5. Execute `cargo new my_bot`, enter the directory and put these lines into your `Cargo.toml`: ```toml [dependencies] -teloxide = "0.3.1" -teloxide-macros = "0.3.2" +teloxide = "0.3" +teloxide-macros = "0.3" log = "0.4.8" pretty_env_logger = "0.4.0" From f785367bea8152d850531e996895a4ffb1f61f1c Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Fri, 23 Oct 2020 08:38:00 +0600 Subject: [PATCH 3/4] Add a missing trait bound --- src/types/login_url.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/types/login_url.rs b/src/types/login_url.rs index 0fc65f10..36515cd6 100644 --- a/src/types/login_url.rs +++ b/src/types/login_url.rs @@ -23,7 +23,10 @@ pub struct LoginUrl { } impl LoginUrl { - pub fn new(url: S) -> Self { + pub fn new(url: S) -> Self + where + S: Into, + { Self { url: url.into(), forward_text: None, bot_username: None, request_write_access: None } } From c40f15487a0cf40c1f432ddfe65998a094e3235c Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Fri, 23 Oct 2020 09:02:00 +0600 Subject: [PATCH 4/4] Fix conflicts in CHANGELOG.md --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index deaea888..3afd074d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [unreleased] + +### Added + - Allow arbitrary error types to be returned from (sub)transitions ([issue 242](https://github.com/teloxide/teloxide/issues/242)). + - The `respond` function, a shortcut for `ResponseResult::Ok(())`. + +### Changed + - Allow `bot_name` be `N`, where `N: Into + ...` in `commands_repl` & `commands_repl_with_listener`. + - 'Edit methods' (namely `edit_message_live_location`, `stop_message_live_location`, `edit_message_text`, + `edit_message_caption`, `edit_message_media` and `edit_message_reply_markup`) are split into common and inline + versions (e.g.: `edit_message_text` and `edit_inline_message_text`). Instead of `ChatOrInlineMessage` common versions + accept `chat_id: impl Into` and `message_id: i32` whereas inline versions accept + `inline_message_id: impl Into`. Also note that return type of inline versions is `True` ([issue 253], [pr 257]) + - `ChatOrInlineMessage` is renamed to `TargetMessage`, it's `::Chat` variant is renamed to `::Common`, + `#[non_exhaustive]` annotation is removed from the enum, type of `TargetMessage::Inline::inline_message_id` changed + `i32` => `String`. `TargetMessage` now implements `From`, `get_game_high_scores` and `set_game_score` use + `Into` to accept `String`s. ([issue 253], [pr 257]) + +[issue 253]: https://github.com/teloxide/teloxide/issues/253 +[pr 257]: https://github.com/teloxide/teloxide/pull/257 + +## [0.3.2] - 2020-10-23 + +### Added + - `LoginUrl::new` ([issue 298](https://github.com/teloxide/teloxide/issues/298)) + ## [0.3.1] - 2020-08-25 ### Added