From b1a8e9ba9b66e65058ed580c34c2b3fddcc9e151 Mon Sep 17 00:00:00 2001 From: Mr-Andersen Date: Tue, 3 Sep 2019 14:40:23 +0300 Subject: [PATCH] Included chat_member.rs in mod.rs, fixed bug, added Audio --- src/core/types/audio.rs | 13 +++++++++++++ src/core/types/chat_member.rs | 4 +++- src/core/types/document.rs | 4 ++-- src/core/types/mod.rs | 8 ++++++++ src/core/types/not_implemented_types.rs | 6 +++--- 5 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 src/core/types/audio.rs diff --git a/src/core/types/audio.rs b/src/core/types/audio.rs new file mode 100644 index 00000000..eb25c1be --- /dev/null +++ b/src/core/types/audio.rs @@ -0,0 +1,13 @@ +use crate::core::types::PhotoSize; + + +#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq)] +pub struct Audio { + pub file_id: String, + pub duration: u32, + pub performer: Option, + pub title: Option, + pub mime_type: Option, + pub file_size: Option, + pub thumb: Option +} \ No newline at end of file diff --git a/src/core/types/chat_member.rs b/src/core/types/chat_member.rs index 1ffb0c5c..b4b5007c 100644 --- a/src/core/types/chat_member.rs +++ b/src/core/types/chat_member.rs @@ -1,4 +1,6 @@ -use serde::Deserialize; +use crate::core::types::{ + User, ChatMemberStatus, Integer +}; /// This object contains information about one member of the chat. #[derive(Debug, Deserialize, Hash, PartialEq, Eq)] diff --git a/src/core/types/document.rs b/src/core/types/document.rs index 6ff03d81..dafc4d17 100644 --- a/src/core/types/document.rs +++ b/src/core/types/document.rs @@ -1,4 +1,4 @@ -use crate::core::types::PhotoSize; +use crate::core::types::{PhotoSize, UnsignedInteger}; #[derive(Debug, Deserialize, Hash, PartialEq, Eq)] pub struct Document { @@ -6,5 +6,5 @@ pub struct Document { pub thumb: Option, pub file_name: Option, pub mime_type: Option, - pub file_size: Option, + pub file_size: Option, } diff --git a/src/core/types/mod.rs b/src/core/types/mod.rs index 3d815491..1df58800 100644 --- a/src/core/types/mod.rs +++ b/src/core/types/mod.rs @@ -2,12 +2,18 @@ mod not_implemented_types; use self::not_implemented_types::*; +pub type Integer = i32; +pub type UnsignedInteger = u32; + + pub use self::{ answer_pre_checkout_query::AnswerPreCheckoutQuery, answer_shipping_query::AnswerShippingQuery, + audio::Audio, chat::Chat, chat_permissions::ChatPermissions, chat_photo::ChatPhoto, + chat_member::ChatMember, document::Document, invoice::Invoice, label_price::LabeledPrice, @@ -26,9 +32,11 @@ pub use self::{ mod answer_pre_checkout_query; mod answer_shipping_query; +mod audio; mod chat; mod chat_permissions; mod chat_photo; +mod chat_member; mod document; mod invoice; mod label_price; diff --git a/src/core/types/not_implemented_types.rs b/src/core/types/not_implemented_types.rs index cb66a40b..a28e3997 100644 --- a/src/core/types/not_implemented_types.rs +++ b/src/core/types/not_implemented_types.rs @@ -16,9 +16,6 @@ pub struct Poll; #[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] pub struct Animation; -#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] -pub struct Audio; - #[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] pub struct Game; @@ -39,3 +36,6 @@ pub struct Voice; #[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] pub struct MaskPosition; + +#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] +pub struct ChatMemberStatus;