Add NotEnoughRightsToManagePins error

Fixes teloxide/teloxide#371
This commit is contained in:
handlerug 2021-04-27 23:40:01 +07:00
parent 1d20dace9a
commit b3dec316e5
No known key found for this signature in database
GPG key ID: 38009F0605051491

View file

@ -373,6 +373,18 @@ pub enum ApiError {
#[serde(rename = "Bad Request: not enough rights to pin a message")]
NotEnoughRightsToPinMessage,
/// Occurs when bot tries to pin or unpin a message without rights to pin
/// in this chat.
///
/// May happen in methods:
/// 1. [`PinChatMessage`]
/// 2. [`UnpinChatMessage`]
///
/// [`PinChatMessage`]: crate::payloads::PinChatMessage
/// [`UnpinChatMessage`]: crate::payloads::UnpinChatMessage
#[serde(rename = "Bad Request: not enough rights to manage pinned messages in the chat")]
NotEnoughRightsToManagePins,
/// 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")]