Merge pull request #155 from teloxide/not_enough_permissions_error

Add `ApiError::NotEnoughRightsToChangeChatPermissions`
This commit is contained in:
Waffle Maybe 2021-12-28 17:07:31 +03:00 committed by GitHub
commit 1219c8fbe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -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

View file

@ -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")]