Make WebhookInfo::allowed_updates typed

This commit is contained in:
Maybe Waffle 2022-02-01 18:30:40 +03:00
parent 8556256e89
commit a36794c5d3
2 changed files with 6 additions and 2 deletions

View file

@ -51,7 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- How forwarded messages are represented ([#151][pr151]) - How forwarded messages are represented ([#151][pr151])
- `RequestError::InvalidJson` now has a `raw` field with raw json for easier debugability ([#150][pr150]) - `RequestError::InvalidJson` now has a `raw` field with raw json for easier debugability ([#150][pr150])
- `ChatPermissions` is now bitflags ([#157][pr157]) - `ChatPermissions` is now bitflags ([#157][pr157])
- Type of `WebhookInfo::ip_address` from `String` to `std::net::IpAddr` ([#172][pr172]) - Type of `WebhookInfo::ip_address` from `Option<String>` to `Option<std::net::IpAddr>` ([#172][pr172])
- Type of `WebhookInfo::allowed_updates` from `Option<Vec<String>>` to `Option<Vec<AllowedUpdate>>` ([#174][pr174])
[pr115]: https://github.com/teloxide/teloxide-core/pull/115 [pr115]: https://github.com/teloxide/teloxide-core/pull/115
[pr125]: https://github.com/teloxide/teloxide-core/pull/125 [pr125]: https://github.com/teloxide/teloxide-core/pull/125
@ -60,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[pr157]: https://github.com/teloxide/teloxide-core/pull/157 [pr157]: https://github.com/teloxide/teloxide-core/pull/157
[pr167]: https://github.com/teloxide/teloxide-core/pull/167 [pr167]: https://github.com/teloxide/teloxide-core/pull/167
[pr172]: https://github.com/teloxide/teloxide-core/pull/172 [pr172]: https://github.com/teloxide/teloxide-core/pull/172
[pr174]: https://github.com/teloxide/teloxide-core/pull/174
### Fixed ### Fixed

View file

@ -3,6 +3,8 @@ use std::net::IpAddr;
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::types::AllowedUpdate;
/// Contains information about the current status of a webhook. /// Contains information about the current status of a webhook.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#webhookinfo). /// [The official docs](https://core.telegram.org/bots/api#webhookinfo).
@ -38,5 +40,5 @@ pub struct WebhookInfo {
/// A list of update types the bot is subscribed to. Defaults to all update /// A list of update types the bot is subscribed to. Defaults to all update
/// types. /// types.
pub allowed_updates: Option<Vec<String>>, pub allowed_updates: Option<Vec<AllowedUpdate>>,
} }