From ae88d56e0dfba9ffaef1bea2240f15f61c9895ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=8B=D1=80=D1=86=D0=B5=D0=B2=20=D0=92=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=20=D0=98=D0=B3=D0=BE=D1=80=D0=B5=D0=B2=D0=B8=D1=87?= Date: Wed, 31 Jul 2024 16:19:29 +0300 Subject: [PATCH] Add `filter_forward_origin` --- CHANGELOG.md | 2 +- crates/teloxide-core/src/types/external_reply_info.rs | 6 +++--- crates/teloxide/src/dispatching/filter_ext.rs | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7d77f12..0bb6b0bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,7 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - MSRV (Minimal Supported Rust Version) was bumped from `1.68.0` to `1.70.0` ([PR 996][https://github.com/teloxide/teloxide/pull/996]) - `axum` was bumped to `0.7`, along with related libraries used for webhooks ([PR 1093][https://github.com/teloxide/teloxide/pull/1093]) - `Polling`'s exponential backoff now results in 64 seconds maximum delay instead of 17 minutes ([PR 1113][https://github.com/teloxide/teloxide/pull/1113]) -- `filter_forward_from` was removed ([PR 1101](https://github.com/teloxide/teloxide/pull/1101)) +- `filter_forward_from` was renamed to `filter_forward_origin` and now returns `MessageOrigin` instead of `ForwardFrom` ([PR 1101](https://github.com/teloxide/teloxide/pull/1101)) ### Removed diff --git a/crates/teloxide-core/src/types/external_reply_info.rs b/crates/teloxide-core/src/types/external_reply_info.rs index 0dcd9e09..14c89ae3 100644 --- a/crates/teloxide-core/src/types/external_reply_info.rs +++ b/crates/teloxide-core/src/types/external_reply_info.rs @@ -20,9 +20,9 @@ pub struct ExternalReplyInfo { #[serde(with = "crate::types::option_msg_id_as_int")] pub message_id: Option, /// Options used for link preview generation for the original message, if it - /// is a text message + /// is a text message. pub link_preview_options: Option, - /// _true_, if the message media is covered by a spoiler animation + /// _true_, if the message media is covered by a spoiler animation. #[serde(default)] pub has_media_spoiler: bool, @@ -38,7 +38,7 @@ pub enum ExternalReplyInfoKind { // - `Animation` must be in front of `Document` // // This is needed so serde doesn't parse `Venue` as `Location` or `Animation` as `Document` - // (for backward compatability telegram duplicates some fields) + // (for backward compatability telegram duplicates some fields). // // See Animation(Animation), diff --git a/crates/teloxide/src/dispatching/filter_ext.rs b/crates/teloxide/src/dispatching/filter_ext.rs index 445acc52..1f7394e3 100644 --- a/crates/teloxide/src/dispatching/filter_ext.rs +++ b/crates/teloxide/src/dispatching/filter_ext.rs @@ -95,6 +95,7 @@ define_message_ext! { (filter_migration_from, Message::migrate_from_chat_id), (filter_migration_to, Message::migrate_to_chat_id), (filter_reply_to_message, Message::reply_to_message), + (filter_forward_origin, Message::forward_origin), // Rest variants of a MessageKind (filter_new_chat_members, Message::new_chat_members), (filter_left_chat_member, Message::left_chat_member),