mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
1
This commit is contained in:
parent
0c0e1014c1
commit
7544bb30d9
1 changed files with 47 additions and 0 deletions
|
@ -39,3 +39,50 @@ pub enum RequestError {
|
|||
}
|
||||
|
||||
//</editor-fold>
|
||||
|
||||
#[derive(Debug, Deserialize, PartialEq, Copy, Hash, Eq)]
|
||||
enum ApiErrorKind {
|
||||
/// Occurs when the bot has been blocked by the user.
|
||||
#[serde(rename = "Forbidden: bot was blocked by the user")]
|
||||
BotBlocked,
|
||||
|
||||
/// Occurs when bot trying to modify a message without modification content
|
||||
#[serde(rename = "Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message")]
|
||||
MessageNotModified,
|
||||
|
||||
/// Occurs when bot trying to forward or delete a message which was deleted
|
||||
#[serde(rename = "Bad Request: MESSAGE_ID_INVALID")]
|
||||
MessageIdInvalid,
|
||||
|
||||
/// Occurs when bot trying to forward a message which does not exists
|
||||
#[serde(rename = "Bad Request: message to forward not found")]
|
||||
MessageToForwardNotFound,
|
||||
|
||||
/// Occurs when bot trying to delete a message which does not exists
|
||||
#[serde(rename = "Bad Request: message to delete not found")]
|
||||
MessageToDeleteNotFound,
|
||||
|
||||
/// Occurs when bot trying to send a text message without text
|
||||
#[serde(rename = "Bad Request: message text is empty")]
|
||||
MessageTextIsEmpty,
|
||||
|
||||
MessageCantBeEdited, //?
|
||||
|
||||
MessageCantBeDeleted, //?
|
||||
|
||||
/// Occurs when bot trying to edit a message which does not exists
|
||||
#[serde(rename = "Bad Request: message to edit not found")]
|
||||
MessageToEditNotFound,
|
||||
|
||||
/// Occurs when bot trying to reply to a message which does not exists
|
||||
#[serde(rename = "Bad Request: reply message not found")]
|
||||
MessageToReplyNotFound,
|
||||
|
||||
ToMuchMessages, //?
|
||||
|
||||
PollCantBeStopped, //?
|
||||
|
||||
/// Occurs when bot trying to stop poll that has already been stopped
|
||||
#[serde(rename = "Bad Request: poll has already been closed")]
|
||||
PollHasAlreadyClosed,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue