Merge pull request #84 from handlerug/patch-error-manage-pins

Add NotEnoughRightsToManagePins and BotKickedFromSupergroup errors
This commit is contained in:
Waffle Lapkin 2021-04-27 23:19:27 +03:00 committed by GitHub
commit 2865127963
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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")]
@ -475,6 +487,16 @@ pub enum ApiError {
#[serde(rename = "Unauthorized: bot was kicked from a chat")]
BotKicked,
/// Occurs when bot tries to do something in a supergroup the bot was
/// kicked from.
///
/// May happen in methods:
/// 1. [`SendMessage`]
///
/// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Forbidden: bot was kicked from the supergroup chat")]
BotKickedFromSupergroup,
/// Occurs when bot tries to send message to deactivated user.
///
/// May happen in methods: