mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Merge pull request #84 from handlerug/patch-error-manage-pins
Add NotEnoughRightsToManagePins and BotKickedFromSupergroup errors
This commit is contained in:
commit
2865127963
1 changed files with 22 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue