From f76db0544f7bf83ff364928c64ce96087e57d61d Mon Sep 17 00:00:00 2001 From: TheAwiteb Date: Fri, 25 Aug 2023 16:14:49 +0300 Subject: [PATCH] Add `MessageToCopyNotFound` to `teloxide::errors::ApiError`. Fix https://github.com/teloxide/teloxide/issues/916 --- crates/teloxide-core/src/errors.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/teloxide-core/src/errors.rs b/crates/teloxide-core/src/errors.rs index 95c1e765..8741668d 100644 --- a/crates/teloxide-core/src/errors.rs +++ b/crates/teloxide-core/src/errors.rs @@ -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), (