1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#[derive(Clone, Debug, Deserialize)] pub struct Message { pub message_id: i64, pub from: User, pub date: i32, pub chat: Chat, pub text: Option<String>, } #[derive(Clone, Debug, Deserialize)] pub struct InlineQuery { pub id: String, pub from: User, pub query: String, pub offset: String, } #[derive(Clone, Debug, Deserialize)] pub struct ChosenInlineResult { pub result_id: String, pub from: User, pub query: String, } #[derive(Clone, Debug, Deserialize)] pub struct User { pub id: i64, pub first_name: String, pub last_name: Option<String>, pub username: Option<String>, pub language_code: Option<String>, } #[derive(Clone, Debug, Deserialize)] pub struct Chat { pub id: i64, #[serde(rename="type")] pub chat_type: ChatType, pub title: Option<String>, pub username: Option<String>, pub first_name: Option<String>, pub last_name: Option<String>, pub all_members_are_administrators: Option<bool>, } #[derive(Clone, Copy, PartialEq, Eq, Debug, Deserialize)] #[serde(rename_all="lowercase")] pub enum ChatType { Private, Group, SuperGroup, Channel, }