mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Add Chat::has_protected_content
This commit is contained in:
parent
4af317e1fd
commit
22159867bb
4 changed files with 13 additions and 2 deletions
|
@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- `ApiError::TooMuchInlineQueryResults` ([#135][pr135])
|
- `ApiError::TooMuchInlineQueryResults` ([#135][pr135])
|
||||||
- `ApiError::NotEnoughRightsToChangeChatPermissions` ([#155][pr155])
|
- `ApiError::NotEnoughRightsToChangeChatPermissions` ([#155][pr155])
|
||||||
- Support for 5.4 telegram bot API ([#133][pr133])
|
- Support for 5.4 telegram bot API ([#133][pr133])
|
||||||
- Support for 5.5 telegram bot API ([#143][pr143])
|
- Support for 5.5 telegram bot API ([#143][pr143], [#164][pr164])
|
||||||
- `EditedMessageIsTooLong` error ([#109][pr109])
|
- `EditedMessageIsTooLong` error ([#109][pr109])
|
||||||
- `UntilDate` enum and use it for `{Restricted, Banned}::until_date` ([#116][pr116])
|
- `UntilDate` enum and use it for `{Restricted, Banned}::until_date` ([#116][pr116])
|
||||||
- `Limits::messages_per_min_channel` ([#121][pr121])
|
- `Limits::messages_per_min_channel` ([#121][pr121])
|
||||||
|
@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
[pr143]: https://github.com/teloxide/teloxide-core/pull/143
|
[pr143]: https://github.com/teloxide/teloxide-core/pull/143
|
||||||
[pr151]: https://github.com/teloxide/teloxide-core/pull/151
|
[pr151]: https://github.com/teloxide/teloxide-core/pull/151
|
||||||
[pr155]: https://github.com/teloxide/teloxide-core/pull/155
|
[pr155]: https://github.com/teloxide/teloxide-core/pull/155
|
||||||
|
[pr164]: https://github.com/teloxide/teloxide-core/pull/164
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,12 @@ pub struct Chat {
|
||||||
///
|
///
|
||||||
/// [`GetChat`]: crate::payloads::GetChat
|
/// [`GetChat`]: crate::payloads::GetChat
|
||||||
pub message_auto_delete_time: Option<u32>,
|
pub message_auto_delete_time: Option<u32>,
|
||||||
|
|
||||||
|
/// `true`, if messages from the chat can't be forwarded to other chats.
|
||||||
|
/// Returned only in [`GetChat`].
|
||||||
|
///
|
||||||
|
/// [`GetChat`]: crate::payloads::GetChat
|
||||||
|
pub has_protected_content: Option<True>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
|
@ -97,7 +103,7 @@ pub struct ChatPrivate {
|
||||||
pub bio: Option<String>,
|
pub bio: Option<String>,
|
||||||
|
|
||||||
/// `True`, if privacy settings of the other party in the private chat
|
/// `True`, if privacy settings of the other party in the private chat
|
||||||
/// allows to use tg://user?id=<user_id> links only in chats with the
|
/// allows to use `tg://user?id=<user_id>` links only in chats with the
|
||||||
/// user. Returned only in [`GetChat`].
|
/// user. Returned only in [`GetChat`].
|
||||||
///
|
///
|
||||||
/// [`GetChat`]: crate::payloads::GetChat
|
/// [`GetChat`]: crate::payloads::GetChat
|
||||||
|
@ -450,6 +456,7 @@ mod tests {
|
||||||
photo: None,
|
photo: None,
|
||||||
pinned_message: None,
|
pinned_message: None,
|
||||||
message_auto_delete_time: None,
|
message_auto_delete_time: None,
|
||||||
|
has_protected_content: None,
|
||||||
};
|
};
|
||||||
let actual = from_str(r#"{"id":-1,"type":"channel","username":"channelname"}"#).unwrap();
|
let actual = from_str(r#"{"id":-1,"type":"channel","username":"channelname"}"#).unwrap();
|
||||||
assert_eq!(expected, actual);
|
assert_eq!(expected, actual);
|
||||||
|
@ -471,6 +478,7 @@ mod tests {
|
||||||
photo: None,
|
photo: None,
|
||||||
pinned_message: None,
|
pinned_message: None,
|
||||||
message_auto_delete_time: None,
|
message_auto_delete_time: None,
|
||||||
|
has_protected_content: None,
|
||||||
},
|
},
|
||||||
from_str(r#"{"id":0,"type":"private","username":"username","first_name":"Anon"}"#)
|
from_str(r#"{"id":0,"type":"private","username":"username","first_name":"Anon"}"#)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
|
@ -1343,6 +1343,7 @@ mod tests {
|
||||||
photo: None,
|
photo: None,
|
||||||
pinned_message: None,
|
pinned_message: None,
|
||||||
message_auto_delete_time: None,
|
message_auto_delete_time: None,
|
||||||
|
has_protected_content: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert!(message.from().unwrap().is_anonymous());
|
assert!(message.from().unwrap().is_anonymous());
|
||||||
|
|
|
@ -198,6 +198,7 @@ mod test {
|
||||||
photo: None,
|
photo: None,
|
||||||
pinned_message: None,
|
pinned_message: None,
|
||||||
message_auto_delete_time: None,
|
message_auto_delete_time: None,
|
||||||
|
has_protected_content: None,
|
||||||
},
|
},
|
||||||
kind: MessageKind::Common(MessageCommon {
|
kind: MessageKind::Common(MessageCommon {
|
||||||
from: Some(User {
|
from: Some(User {
|
||||||
|
|
Loading…
Reference in a new issue