Merge pull request #917 from TheAwiteb/message_to_copy_not_found_error

Add `MessageToCopyNotFound` to `teloxide::errors::ApiError`
This commit is contained in:
Waffle Maybe 2023-09-22 17:39:10 +00:00 committed by GitHub
commit 88c0ad60a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## unreleased
### Added
- Add `MessageToCopyNotFound` error to `teloxide::errors::ApiError` ([PR 917](https://github.com/teloxide/teloxide/pull/917))
### Fixed
- Use `UserId` instead of `i64` for `user_id` in `html::user_mention` and `markdown::user_mention` ([PR 896](https://github.com/teloxide/teloxide/pull/896))

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),
(