Add missing Chat::message_auto_delete_time field (tba 5.1)

This commit is contained in:
Waffle 2021-04-27 11:48:16 +03:00
parent b55bdd274b
commit bd52e93cdb
2 changed files with 9 additions and 0 deletions

View file

@ -28,6 +28,12 @@ pub struct Chat {
///
/// [`GetChat`]: crate::payloads::GetChat
pub pinned_message: Option<Box<Message>>,
/// The time after which all messages sent to the chat will be automatically
/// deleted; in seconds. Returned only in [`GetChat`].
///
/// [`GetChat`]: crate::payloads::GetChat
pub message_auto_delete_time: Option<u32>,
}
#[serde_with_macros::skip_serializing_none]
@ -424,6 +430,7 @@ mod tests {
}),
photo: None,
pinned_message: None,
message_auto_delete_time: None,
};
let actual = from_str(r#"{"id":-1,"type":"channel","username":"channelname"}"#).unwrap();
assert_eq!(expected, actual);
@ -443,6 +450,7 @@ mod tests {
}),
photo: None,
pinned_message: None,
message_auto_delete_time: None,
},
from_str(r#"{"id":0,"type":"private","username":"username","first_name":"Anon"}"#)
.unwrap()

View file

@ -186,6 +186,7 @@ mod test {
}),
photo: None,
pinned_message: None,
message_auto_delete_time: None,
},
kind: MessageKind::Common(MessageCommon {
from: Some(User {