diff --git a/CHANGELOG.md b/CHANGELOG.md index 500d867e..e9a97f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - `ApiError::TooMuchInlineQueryResults` ([#135][pr135]) +- `ApiError::NotEnoughRightsToChangeChatPermissions` ([#155][pr155]) - Support for 5.4 telegram bot API ([#133][pr133]) - Support for 5.5 telegram bot API ([#143][pr143]) - `EditedMessageIsTooLong` error ([#109][pr109]) @@ -27,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [pr140]: https://github.com/teloxide/teloxide-core/pull/140 [pr143]: https://github.com/teloxide/teloxide-core/pull/143 [pr151]: https://github.com/teloxide/teloxide-core/pull/151 +[pr155]: https://github.com/teloxide/teloxide-core/pull/155 ### Changed diff --git a/src/errors.rs b/src/errors.rs index 03fcffd9..27d1afb6 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -493,6 +493,17 @@ pub enum ApiError { #[error("Bad Request: not enough rights to manage pinned messages in the chat")] NotEnoughRightsToManagePins, + /// Occurs when bot tries change default chat permissions without "Ban + /// Users" permission in this chat. + /// + /// May happen in methods: + /// 1. [`SetChatPermissions`] + /// + /// [`SetChatPermissions`]: crate::payloads::SetChatPermissions + #[serde(rename = "Bad Request: not enough rights to change chat permissions")] + #[error("Bad Request: not enough rights to change chat permissions")] + NotEnoughRightsToChangeChatPermissions, + /// Occurs when bot tries to use method in group which is allowed only in a /// supergroup or channel. #[serde(rename = "Bad Request: method is available only for supergroups and channel")]