From 3977b79b90a6a5e7a0670a2b3988a42d81117498 Mon Sep 17 00:00:00 2001 From: Johannes Dertmann Date: Thu, 29 Aug 2024 00:17:37 +0200 Subject: [PATCH] Add BotKickedFromChannel variant to ApiError --- crates/teloxide-core/CHANGELOG.md | 2 ++ crates/teloxide-core/src/errors.rs | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/teloxide-core/CHANGELOG.md b/crates/teloxide-core/CHANGELOG.md index 7d3eb13d..906527cd 100644 --- a/crates/teloxide-core/CHANGELOG.md +++ b/crates/teloxide-core/CHANGELOG.md @@ -42,6 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `BusinessMessagesDeleted` struct - Add `BusinessConnection`, `BusinessMessage`, `EditedBusinessMessage` and `DeletedBusinessMessages` variants to `UpdateKind` enum +- `ApiError::BotKickedFromChannel` + ### Changed - `MaybeAnonymousUser` type introduced, which replaced `PollAnswer::voter: Voter` and `MessageReactionUpdated::{user, actor_chat}` in `MessageReactionUpdated`([#1134][pr1134]) diff --git a/crates/teloxide-core/src/errors.rs b/crates/teloxide-core/src/errors.rs index fc0d707b..d8e6b611 100644 --- a/crates/teloxide-core/src/errors.rs +++ b/crates/teloxide-core/src/errors.rs @@ -644,6 +644,15 @@ impl_api_error! { /// [`SendMessage`]: crate::payloads::SendMessage BotKickedFromSupergroup = "Forbidden: bot was kicked from the supergroup chat", + /// Occurs when bot tries to do something in a channel the bot was + /// kicked from. + /// + /// May happen in methods: + /// 1. [`SendMessage`] + /// + /// [`SendMessage`]: crate::payloads::SendMessage + BotKickedFromChannel = "Forbidden: bot was kicked from the channel chat", + /// Occurs when bot tries to send a message to a deactivated user (i.e. a /// user that was banned by telegram). ///