Add ChatBoostAdded struct

This commit is contained in:
Andrey Brusnik 2024-07-20 17:39:44 +04:00
parent 9d45244efb
commit 02d7a3cd2e
No known key found for this signature in database
GPG key ID: D33232F28CFF442C
2 changed files with 26 additions and 0 deletions

View file

@ -14,6 +14,7 @@ pub use chat::*;
pub use chat_action::*; pub use chat_action::*;
pub use chat_administrator_rights::*; pub use chat_administrator_rights::*;
pub use chat_boost::*; pub use chat_boost::*;
pub use chat_boost_added::*;
pub use chat_boost_removed::*; pub use chat_boost_removed::*;
pub use chat_boost_source::*; pub use chat_boost_source::*;
pub use chat_boost_updated::*; pub use chat_boost_updated::*;
@ -273,6 +274,7 @@ mod web_app_info;
mod webhook_info; mod webhook_info;
mod write_access_allowed; mod write_access_allowed;
mod chat_boost_added;
mod inline_query; mod inline_query;
mod inline_query_result; mod inline_query_result;
mod inline_query_result_article; mod inline_query_result_article;

View file

@ -0,0 +1,24 @@
use serde::{Deserialize, Serialize};
/// This object represents a service message about a user boosting a chat.
#[serde_with::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChatBoostAdded {
/// Number of boosts added by the user
pub boost_count: u16,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn deserialize() {
let data = r#"
{
"boost_count": 4
}
"#;
serde_json::from_str::<ChatBoostAdded>(data).unwrap();
}
}