From dcdc776c509c3147660795da199c6af687f3933c Mon Sep 17 00:00:00 2001 From: P0lunin Date: Tue, 3 Sep 2019 20:56:43 +0300 Subject: [PATCH] add struct and set fields type to 'pub' --- src/core/types/callback_game.rs | 2 +- src/core/types/game.rs | 13 +++++++++++++ src/core/types/game_high_score.rs | 8 ++++---- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 src/core/types/game.rs diff --git a/src/core/types/callback_game.rs b/src/core/types/callback_game.rs index e5ef8069..db173b68 100644 --- a/src/core/types/callback_game.rs +++ b/src/core/types/callback_game.rs @@ -1,2 +1,2 @@ /// A placeholder, currently holds no information. Use [BotFather](https://t.me/botfather) to set up your game. -struct CallbackGame; \ No newline at end of file +pub struct CallbackGame; \ No newline at end of file diff --git a/src/core/types/game.rs b/src/core/types/game.rs new file mode 100644 index 00000000..26890b06 --- /dev/null +++ b/src/core/types/game.rs @@ -0,0 +1,13 @@ +use serde::Deserialize; + +use crate::core::types::MessageEntity; + +#[derive(Debug, Deserialize)] +pub struct Game { + pub title: String, + pub description: String, + pub photo: Vec, + pub text: Option, + pub text_entities: Option>, + pub animation: Option, +} \ No newline at end of file diff --git a/src/core/types/game_high_score.rs b/src/core/types/game_high_score.rs index f000ff36..97e5329b 100644 --- a/src/core/types/game_high_score.rs +++ b/src/core/types/game_high_score.rs @@ -3,8 +3,8 @@ use serde::Deserialize; use crate::core::types::user::User; #[derive(Debug, Deserialize)] -struct GameHighScore { - position: i32, - user: User, - score: i32, +pub struct GameHighScore { + pub position: i32, + pub user: User, + pub score: i32, } \ No newline at end of file