Included chat_member.rs in mod.rs, fixed bug, added Audio

This commit is contained in:
Mr-Andersen 2019-09-03 14:40:23 +03:00
parent 8511aeb609
commit b1a8e9ba9b
5 changed files with 29 additions and 6 deletions

13
src/core/types/audio.rs Normal file
View file

@ -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<String>,
pub title: Option<String>,
pub mime_type: Option<String>,
pub file_size: Option<u32>,
pub thumb: Option<PhotoSize>
}

View file

@ -1,4 +1,6 @@
use serde::Deserialize; use crate::core::types::{
User, ChatMemberStatus, Integer
};
/// This object contains information about one member of the chat. /// This object contains information about one member of the chat.
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)] #[derive(Debug, Deserialize, Hash, PartialEq, Eq)]

View file

@ -1,4 +1,4 @@
use crate::core::types::PhotoSize; use crate::core::types::{PhotoSize, UnsignedInteger};
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)] #[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct Document { pub struct Document {
@ -6,5 +6,5 @@ pub struct Document {
pub thumb: Option<PhotoSize>, pub thumb: Option<PhotoSize>,
pub file_name: Option<String>, pub file_name: Option<String>,
pub mime_type: Option<String>, pub mime_type: Option<String>,
pub file_size: Option<i64>, pub file_size: Option<UnsignedInteger>,
} }

View file

@ -2,12 +2,18 @@ mod not_implemented_types;
use self::not_implemented_types::*; use self::not_implemented_types::*;
pub type Integer = i32;
pub type UnsignedInteger = u32;
pub use self::{ pub use self::{
answer_pre_checkout_query::AnswerPreCheckoutQuery, answer_pre_checkout_query::AnswerPreCheckoutQuery,
answer_shipping_query::AnswerShippingQuery, answer_shipping_query::AnswerShippingQuery,
audio::Audio,
chat::Chat, chat::Chat,
chat_permissions::ChatPermissions, chat_permissions::ChatPermissions,
chat_photo::ChatPhoto, chat_photo::ChatPhoto,
chat_member::ChatMember,
document::Document, document::Document,
invoice::Invoice, invoice::Invoice,
label_price::LabeledPrice, label_price::LabeledPrice,
@ -26,9 +32,11 @@ pub use self::{
mod answer_pre_checkout_query; mod answer_pre_checkout_query;
mod answer_shipping_query; mod answer_shipping_query;
mod audio;
mod chat; mod chat;
mod chat_permissions; mod chat_permissions;
mod chat_photo; mod chat_photo;
mod chat_member;
mod document; mod document;
mod invoice; mod invoice;
mod label_price; mod label_price;

View file

@ -16,9 +16,6 @@ pub struct Poll;
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] #[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
pub struct Animation; pub struct Animation;
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
pub struct Audio;
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] #[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
pub struct Game; pub struct Game;
@ -39,3 +36,6 @@ pub struct Voice;
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] #[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
pub struct MaskPosition; pub struct MaskPosition;
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
pub struct ChatMemberStatus;