Add MessageToCopyNotFound to teloxide::errors::ApiError. Fix https://github.com/teloxide/teloxide/issues/916

This commit is contained in:
TheAwiteb 2023-08-25 16:14:49 +03:00
parent 556b14eb04
commit f76db0544f
No known key found for this signature in database
GPG key ID: ABF818BD15DC2D34

View file

@ -213,6 +213,13 @@ impl_api_error! {
/// [`DeleteMessage`]: crate::payloads::DeleteMessage
MessageToDeleteNotFound = "Bad Request: message to delete not found",
/// Occurs when bot tries to copy a message which does not exists.
/// May happen in methods:
/// 1. [`CopyMessage`]
///
/// [`CopyMessage`]: crate::payloads::CopyMessage
MessageToCopyNotFound = "Bad Request: message to copy not found",
/// Occurs when bot tries to send a text message without text.
///
/// May happen in methods:
@ -822,6 +829,10 @@ mod tests {
"{\"data\": \"Bad Request: message to delete not found\"}",
ApiError::MessageToDeleteNotFound,
),
(
"{\"data\": \"Bad Request: message to copy not found\"}",
ApiError::MessageToCopyNotFound,
),
("{\"data\": \"Bad Request: message text is empty\"}", ApiError::MessageTextIsEmpty),
("{\"data\": \"Bad Request: message can't be edited\"}", ApiError::MessageCantBeEdited),
(