#[non_exhaustive]
pub enum ApiError {
Show 64 variants BotBlocked, NotFound, MessageNotModified, MessageIdInvalid, MessageToForwardNotFound, MessageToDeleteNotFound, MessageTextIsEmpty, MessageCantBeEdited, MessageCantBeDeleted, MessageToEditNotFound, MessageToReplyNotFound, MessageIdentifierNotSpecified, MessageIsTooLong, EditedMessageIsTooLong, ToMuchMessages, TooMuchInlineQueryResults, PollHasAlreadyClosed, PollMustHaveMoreOptions, PollCantHaveMoreOptions, PollOptionsMustBeNonEmpty, PollQuestionMustBeNonEmpty, PollOptionsLengthTooLong, PollQuestionLengthTooLong, MessageWithPollNotFound, MessageIsNotAPoll, ChatNotFound, UserNotFound, ChatDescriptionIsNotModified, InvalidQueryId, ButtonUrlInvalid, ButtonDataInvalid, TextButtonsAreUnallowed, WrongFileId, WrongFileIdOrUrl, FailedToGetUrlContent, GroupDeactivated, PhotoAsInputFileRequired, InvalidStickersSet, StickerSetNameOccupied, StickerSetOwnerIsBot, InvalidStickerName, NotEnoughRightsToPinMessage, NotEnoughRightsToManagePins, NotEnoughRightsToChangeChatPermissions, MethodNotAvailableInPrivateChats, CantDemoteChatCreator, CantRestrictSelf, NotEnoughRightsToRestrict, NotEnoughRightsToPostMessages, WebhookRequireHttps, BadWebhookPort, UnknownHost, CantParseUrl, CantParseEntities, CantGetUpdates, BotKicked, BotKickedFromSupergroup, UserDeactivated, CantInitiateConversation, CantTalkWithBots, WrongHttpUrl, TerminatedByOtherGetUpdates, FileIdInvalid, Unknown(String),
}
Expand description

A kind of an API error.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BotBlocked

Occurs when the bot tries to send message to user who blocked the bot.

§

NotFound

Occurs when the bot token is incorrect.

§

MessageNotModified

Occurs when bot tries to modify a message without modification content.

May happen in methods:

  1. EditMessageText
§

MessageIdInvalid

Occurs when bot tries to forward or delete a message which was deleted.

May happen in methods:

  1. ForwardMessage
  2. DeleteMessage
§

MessageToForwardNotFound

Occurs when bot tries to forward a message which does not exists.

May happen in methods:

  1. ForwardMessage
§

MessageToDeleteNotFound

Occurs when bot tries to delete a message which does not exists.

May happen in methods:

  1. DeleteMessage
§

MessageTextIsEmpty

Occurs when bot tries to send a text message without text.

May happen in methods:

  1. SendMessage
§

MessageCantBeEdited

Occurs when bot tries to edit a message after long time.

May happen in methods:

  1. EditMessageText
§

MessageCantBeDeleted

Occurs when bot tries to delete a someone else’s message in group where it does not have enough rights.

May happen in methods:

  1. DeleteMessage
§

MessageToEditNotFound

Occurs when bot tries to edit a message which does not exists.

May happen in methods:

  1. EditMessageText
§

MessageToReplyNotFound

Occurs when bot tries to reply to a message which does not exists.

May happen in methods:

  1. SendMessage
§

MessageIdentifierNotSpecified

Occurs when bot tries to

§

MessageIsTooLong

Occurs when bot tries to send a message with text size greater then 4096 symbols.

May happen in methods:

  1. SendMessage
§

EditedMessageIsTooLong

Occurs when bot tries to edit a message with text size greater then 4096 symbols.

May happen in methods:

  1. EditMessageText
  2. EditMessageTextInline
  3. EditMessageCaption
  4. EditMessageCaptionInline
§

ToMuchMessages

Occurs when bot tries to send media group with more than 10 items.

May happen in methods:

  1. SendMediaGroup
§

TooMuchInlineQueryResults

Occurs when bot tries to answer an inline query with more than 50 results.

Consider using offsets to paginate results.

May happen in methods:

  1. AnswerInlineQuery
§

PollHasAlreadyClosed

Occurs when bot tries to stop poll that has already been stopped.

May happen in methods:

  1. SendPoll
§

PollMustHaveMoreOptions

Occurs when bot tries to send poll with less than 2 options.

May happen in methods:

  1. SendPoll
§

PollCantHaveMoreOptions

Occurs when bot tries to send poll with more than 10 options.

May happen in methods:

  1. SendPoll
§

PollOptionsMustBeNonEmpty

Occurs when bot tries to send poll with empty option (without text).

May happen in methods:

  1. SendPoll
§

PollQuestionMustBeNonEmpty

Occurs when bot tries to send poll with empty question (without text).

May happen in methods:

  1. SendPoll
§

PollOptionsLengthTooLong

Occurs when bot tries to send poll with total size of options more than 100 symbols.

May happen in methods:

  1. SendPoll
§

PollQuestionLengthTooLong

Occurs when bot tries to send poll with question size more than 255 symbols.

May happen in methods:

  1. SendPoll
§

MessageWithPollNotFound

Occurs when bot tries to stop poll with message without poll.

May happen in methods:

  1. StopPoll
§

MessageIsNotAPoll

Occurs when bot tries to stop poll with message without poll.

May happen in methods:

  1. StopPoll
§

ChatNotFound

Occurs when bot tries to send a message to chat in which it is not a member.

May happen in methods:

  1. SendMessage
§

UserNotFound

Occurs when bot tries to send method with unknown user_id.

May happen in methods:

  1. getUserProfilePhotos
§

ChatDescriptionIsNotModified

Occurs when bot tries to send SetChatDescription with same text as in the current description.

May happen in methods:

  1. SetChatDescription
§

InvalidQueryId

Occurs when bot tries to answer to query after timeout expire.

May happen in methods:

  1. AnswerCallbackQuery
§

ButtonUrlInvalid

Occurs when bot tries to send InlineKeyboardMarkup with invalid button url.

May happen in methods:

  1. SendMessage
§

ButtonDataInvalid

Occurs when bot tries to send button with data size more than 64 bytes.

May happen in methods:

  1. SendMessage
§

TextButtonsAreUnallowed

Occurs when bot tries to send button with data size == 0.

May happen in methods:

  1. SendMessage
§

WrongFileId

Occurs when bot tries to get file by wrong file id.

May happen in methods:

  1. GetFile
§

WrongFileIdOrUrl

Occurs when bot tries to send files with wrong file identifier or HTTP url

§

FailedToGetUrlContent

Occurs when When sending files with an url to a site that doesn’t respond.

§

GroupDeactivated

Occurs when bot tries to do some with group which was deactivated.

§

PhotoAsInputFileRequired

Occurs when bot tries to set chat photo from file ID

May happen in methods:

  1. SetChatPhoto
§

InvalidStickersSet

Occurs when bot tries to add sticker to stickerset by invalid name.

May happen in methods:

  1. AddStickerToSet
§

StickerSetNameOccupied

Occurs when bot tries to create a sticker set with a name that is already used by another sticker set.

May happen in methods:

  1. CreateNewStickerSet
§

StickerSetOwnerIsBot

Occurs when bot tries to create a sticker set with user id of a bot.

May happen in methods:

  1. CreateNewStickerSet
§

InvalidStickerName

Occurs when bot tries to create a sticker set with invalid name.

From documentation of CreateNewStickerSet:

Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can’t contain consecutive underscores and must end in “_by_<bot_username>”. <bot_username> is case insensitive. 1-64 characters.

May happen in methods:

  1. CreateNewStickerSet
§

NotEnoughRightsToPinMessage

Occurs when bot tries to pin a message without rights to pin in this chat.

May happen in methods:

  1. PinChatMessage
§

NotEnoughRightsToManagePins

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
§

NotEnoughRightsToChangeChatPermissions

Occurs when bot tries change default chat permissions without “Ban Users” permission in this chat.

May happen in methods:

  1. SetChatPermissions
§

MethodNotAvailableInPrivateChats

Occurs when bot tries to use method in group which is allowed only in a supergroup or channel.

§

CantDemoteChatCreator

Occurs when bot tries to demote chat creator.

May happen in methods:

  1. PromoteChatMember
§

CantRestrictSelf

Occurs when bot tries to restrict self in group chats.

May happen in methods:

  1. RestrictChatMember
§

NotEnoughRightsToRestrict

Occurs when bot tries to restrict chat member without rights to restrict in this chat.

May happen in methods:

  1. RestrictChatMember
§

NotEnoughRightsToPostMessages

Occurs when bot tries to post a message in a channel without “Post Messages” admin right.

§

WebhookRequireHttps

Occurs when bot tries set webhook to protocol other than HTTPS.

May happen in methods:

  1. SetWebhook
§

BadWebhookPort

Occurs when bot tries to set webhook to port other than 80, 88, 443 or 8443.

May happen in methods:

  1. SetWebhook
§

UnknownHost

Occurs when bot tries to set webhook to unknown host.

May happen in methods:

  1. SetWebhook
§

CantParseUrl

Occurs when bot tries to set webhook to invalid URL.

May happen in methods:

  1. SetWebhook
§

CantParseEntities

Occurs when bot tries to send message with unfinished entities.

May happen in methods:

  1. SendMessage
§

CantGetUpdates

Occurs when bot tries to use getUpdates while webhook is active.

May happen in methods:

  1. GetUpdates
§

BotKicked

Occurs when bot tries to do some in group where bot was kicked.

May happen in methods:

  1. SendMessage
§

BotKickedFromSupergroup

Occurs when bot tries to do something in a supergroup the bot was kicked from.

May happen in methods:

  1. SendMessage
§

UserDeactivated

Occurs when bot tries to send a message to a deactivated user (i.e. a user that was banned by telegram).

May happen in methods:

  1. SendMessage
§

CantInitiateConversation

Occurs when you tries to initiate conversation with a user.

May happen in methods:

  1. SendMessage
§

CantTalkWithBots

Occurs when you tries to send message to bot.

May happen in methods:

  1. SendMessage
§

WrongHttpUrl

Occurs when bot tries to send button with invalid http url.

May happen in methods:

  1. SendMessage
§

TerminatedByOtherGetUpdates

Occurs when bot tries GetUpdate before the timeout. Make sure that only one Updater is running.

May happen in methods:

  1. GetUpdates
§

FileIdInvalid

Occurs when bot tries to get file by invalid file id.

May happen in methods:

  1. GetFile
§

Unknown(String)

Error which is not known to teloxide.

If you’ve received this error, please open an issue with the description of the error.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
Unerase this erased pointer. Read more
Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Turn this erasable pointer into an erased pointer. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more