diff --git a/CHANGELOG.md b/CHANGELOG.md index b570b7f8..69728953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `filter_video_chat_ended` - `filter_video_chat_participants_invited` - `filter_web_app_data` -- Implement `GetChatId` for `teloxide_core::types::{Chat, ChatJoinRequest, ChatMemberUpdated, Recipient, TargetMessage}`. +- Implement `GetChatId` for `teloxide_core::types::{Chat, ChatJoinRequest, ChatMemberUpdated}`. ### Fixed diff --git a/crates/teloxide/src/dispatching/dialogue/get_chat_id.rs b/crates/teloxide/src/dispatching/dialogue/get_chat_id.rs index 2b27b4a2..632f4bbe 100644 --- a/crates/teloxide/src/dispatching/dialogue/get_chat_id.rs +++ b/crates/teloxide/src/dispatching/dialogue/get_chat_id.rs @@ -1,6 +1,5 @@ use crate::types::{ - CallbackQuery, Chat, ChatId, ChatJoinRequest, ChatMemberUpdated, Message, - Recipient, TargetMessage, Update, + CallbackQuery, Chat, ChatId, ChatJoinRequest, ChatMemberUpdated, Message, Update, }; /// Something that may have a chat ID. @@ -27,30 +26,12 @@ impl GetChatId for Update { } } -impl GetChatId for Recipient { - fn chat_id(&self) -> Option { - match self { - Recipient::Id(chat_id) => Some(*chat_id), - Recipient::ChannelUsername(_) => None, - } - } -} - impl GetChatId for Chat { fn chat_id(&self) -> Option { Some(self.id) } } -impl GetChatId for TargetMessage { - fn chat_id(&self) -> Option { - match self { - TargetMessage::Common { chat_id: recipient, .. } => recipient.chat_id(), - TargetMessage::Inline { .. } => None, - } - } -} - impl GetChatId for ChatMemberUpdated { fn chat_id(&self) -> Option { Some(self.chat.id)