mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-22 06:45:37 +01:00
Merge pull request #917 from TheAwiteb/message_to_copy_not_found_error
Add `MessageToCopyNotFound` to `teloxide::errors::ApiError`
This commit is contained in:
commit
88c0ad60a9
2 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## unreleased
|
## unreleased
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add `MessageToCopyNotFound` error to `teloxide::errors::ApiError` ([PR 917](https://github.com/teloxide/teloxide/pull/917))
|
||||||
### Fixed
|
### 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))
|
- 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))
|
||||||
|
|
||||||
|
|
|
@ -213,6 +213,13 @@ impl_api_error! {
|
||||||
/// [`DeleteMessage`]: crate::payloads::DeleteMessage
|
/// [`DeleteMessage`]: crate::payloads::DeleteMessage
|
||||||
MessageToDeleteNotFound = "Bad Request: message to delete not found",
|
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.
|
/// Occurs when bot tries to send a text message without text.
|
||||||
///
|
///
|
||||||
/// May happen in methods:
|
/// May happen in methods:
|
||||||
|
@ -822,6 +829,10 @@ mod tests {
|
||||||
"{\"data\": \"Bad Request: message to delete not found\"}",
|
"{\"data\": \"Bad Request: message to delete not found\"}",
|
||||||
ApiError::MessageToDeleteNotFound,
|
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 text is empty\"}", ApiError::MessageTextIsEmpty),
|
||||||
("{\"data\": \"Bad Request: message can't be edited\"}", ApiError::MessageCantBeEdited),
|
("{\"data\": \"Bad Request: message can't be edited\"}", ApiError::MessageCantBeEdited),
|
||||||
(
|
(
|
||||||
|
|
Loading…
Add table
Reference in a new issue