Merge pull request #219 from teloxide/new_error_just_dropped_user_is_deactivated

Correct deserialization of `NotFound` and `UserDeactivated` errors
This commit is contained in:
Waffle Maybe 2022-06-02 20:54:23 +04:00 committed by GitHub
commit d70d5f9af1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -9,9 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `ChatId` and `UserId` to the prelude ([#212][pr212])
- Add `is_*` methods to `ChatMemberStatus` analogous to the `ChatMember{,Kind}` methods ([#216][pr216])
- Correct how `NotFound` and `UserDeactivated` errors are deserialized ([#219][pr219])
[pr212]: https://github.com/teloxide/teloxide-core/pull/212
[pr216]: https://github.com/teloxide/teloxide-core/pull/216
[pr219]: https://github.com/teloxide/teloxide-core/pull/219
## 0.6.0 - 2022-04-25

View file

@ -100,8 +100,8 @@ pub enum ApiError {
BotBlocked,
/// Occurs when the bot token is incorrect.
#[serde(rename = "Forbidden: bot was blocked by the user")]
#[error("Forbidden: bot was blocked by the user")]
#[serde(rename = "Not Found")]
#[error("Not Found")]
NotFound,
/// Occurs when bot tries to modify a message without modification content.
@ -684,14 +684,15 @@ pub enum ApiError {
#[error("Forbidden: bot was kicked from the supergroup chat")]
BotKickedFromSupergroup,
/// Occurs when bot tries to send message to deactivated user.
/// Occurs when bot tries to send a message to a deactivated user (i.e. a
/// user that was banned by telegram).
///
/// May happen in methods:
/// 1. [`SendMessage`]
///
/// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Unauthorized: user is deactivated")]
#[error("Unauthorized: user is deactivated")]
#[serde(rename = "Forbidden: user is deactivated")]
#[error("Forbidden: user is deactivated")]
UserDeactivated,
/// Occurs when you tries to initiate conversation with a user.