From 6e176113cd86d480f6649774bcdc7fc163fa8344 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 13 Feb 2024 22:15:08 +0100 Subject: [PATCH] Remove `Message::chat_id`, `Update::user` --- crates/teloxide-core/CHANGELOG.md | 2 ++ crates/teloxide-core/src/types/message.rs | 6 ------ crates/teloxide-core/src/types/update.rs | 5 ----- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/teloxide-core/CHANGELOG.md b/crates/teloxide-core/CHANGELOG.md index 32c517a1..cfb16151 100644 --- a/crates/teloxide-core/CHANGELOG.md +++ b/crates/teloxide-core/CHANGELOG.md @@ -135,6 +135,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `teloxide::dispatching::{update_listeners, repls}` (use `reloxide::{update_listeners, repls}` instead) - `Dispatcher::setup_ctrlc_handler` (use `enable_ctrlc_handler` on the builder instead) - `BotCommands::ty` and `repls::{commands_repl, commands_repl_with_listener}` (use `CommandsRepl::{repl, repl_with_listener}` instead) + - `Message::chat_id` (use `.chat.id`) + - `Update::user` (use `Update::from`) [pr954]: https://github.com/teloxide/teloxide/pull/954 [pr1013]: https://github.com/teloxide/teloxide/pull/1013 diff --git a/crates/teloxide-core/src/types/message.rs b/crates/teloxide-core/src/types/message.rs index d988fad5..3f46a556 100644 --- a/crates/teloxide-core/src/types/message.rs +++ b/crates/teloxide-core/src/types/message.rs @@ -716,12 +716,6 @@ mod getters { } } - #[deprecated(since = "0.4.2", note = "use `.chat.id` field instead")] - #[must_use] - pub fn chat_id(&self) -> ChatId { - self.chat.id - } - #[must_use] pub fn forward(&self) -> Option<&Forward> { self.common().and_then(|m| m.forward.as_ref()) diff --git a/crates/teloxide-core/src/types/update.rs b/crates/teloxide-core/src/types/update.rs index 44a2eeeb..ec41ad94 100644 --- a/crates/teloxide-core/src/types/update.rs +++ b/crates/teloxide-core/src/types/update.rs @@ -231,11 +231,6 @@ impl Update { Some(chat) } - - #[deprecated(note = "renamed to `from`", since = "0.10.0")] - pub fn user(&self) -> Option<&User> { - self.from() - } } impl UpdateId {