mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
Add ChatBoostAdded
struct
This commit is contained in:
parent
9d45244efb
commit
02d7a3cd2e
2 changed files with 26 additions and 0 deletions
|
@ -14,6 +14,7 @@ pub use chat::*;
|
|||
pub use chat_action::*;
|
||||
pub use chat_administrator_rights::*;
|
||||
pub use chat_boost::*;
|
||||
pub use chat_boost_added::*;
|
||||
pub use chat_boost_removed::*;
|
||||
pub use chat_boost_source::*;
|
||||
pub use chat_boost_updated::*;
|
||||
|
@ -273,6 +274,7 @@ mod web_app_info;
|
|||
mod webhook_info;
|
||||
mod write_access_allowed;
|
||||
|
||||
mod chat_boost_added;
|
||||
mod inline_query;
|
||||
mod inline_query_result;
|
||||
mod inline_query_result_article;
|
||||
|
|
24
crates/teloxide-core/src/types/chat_boost_added.rs
Normal file
24
crates/teloxide-core/src/types/chat_boost_added.rs
Normal 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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue