pub struct Game { /* private fields */ }Expand description
This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
Implementations§
source§impl Game
impl Game
pub fn new(title: String, description: String, photo: Vec<PhotoSize>) -> Self
sourcepub fn into_tuple(
self
) -> (String, String, Vec<PhotoSize>, Option<String>, Option<Vec<MessageEntity>>, Option<Animation>)
pub fn into_tuple( self ) -> (String, String, Vec<PhotoSize>, Option<String>, Option<Vec<MessageEntity>>, Option<Animation>)
Consumes and deconstructs this type into a tuple with one element per field. Tuple type returned is: (title, description, photo, text, text_entities, animation)
sourcepub fn get_title_ref<'a>(&'a self) -> &'a str
pub fn get_title_ref<'a>(&'a self) -> &'a str
Title of the game
sourcepub fn set_title<'a>(&'a mut self, title: String) -> &'a mut Self
pub fn set_title<'a>(&'a mut self, title: String) -> &'a mut Self
Title of the game
sourcepub fn get_description<'a>(&'a self) -> Cow<'a, str>
pub fn get_description<'a>(&'a self) -> Cow<'a, str>
Description of the game
sourcepub fn get_description_ref<'a>(&'a self) -> &'a str
pub fn get_description_ref<'a>(&'a self) -> &'a str
Description of the game
sourcepub fn set_description<'a>(&'a mut self, description: String) -> &'a mut Self
pub fn set_description<'a>(&'a mut self, description: String) -> &'a mut Self
Description of the game
sourcepub fn get_photo<'a>(&'a self) -> Cow<'a, Vec<PhotoSize>>
pub fn get_photo<'a>(&'a self) -> Cow<'a, Vec<PhotoSize>>
Photo that will be displayed in the game message in chats.
sourcepub fn get_photo_ref<'a>(&'a self) -> &'a Vec<PhotoSize>
pub fn get_photo_ref<'a>(&'a self) -> &'a Vec<PhotoSize>
Photo that will be displayed in the game message in chats.
sourcepub fn set_photo<'a>(&'a mut self, photo: Vec<PhotoSize>) -> &'a mut Self
pub fn set_photo<'a>(&'a mut self, photo: Vec<PhotoSize>) -> &'a mut Self
Photo that will be displayed in the game message in chats.
sourcepub fn get_text<'a>(&'a self) -> Option<Cow<'a, str>>
pub fn get_text<'a>(&'a self) -> Option<Cow<'a, str>>
Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
sourcepub fn get_text_ref<'a>(&'a self) -> Option<&'a str>
pub fn get_text_ref<'a>(&'a self) -> Option<&'a str>
Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
sourcepub fn set_text<'a>(&'a mut self, text: Option<String>) -> &'a mut Self
pub fn set_text<'a>(&'a mut self, text: Option<String>) -> &'a mut Self
Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
sourcepub fn get_text_entities<'a>(&'a self) -> Option<Cow<'a, Vec<MessageEntity>>>
pub fn get_text_entities<'a>(&'a self) -> Option<Cow<'a, Vec<MessageEntity>>>
Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
sourcepub fn get_text_entities_ref<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>
pub fn get_text_entities_ref<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>
Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
sourcepub fn set_text_entities<'a>(
&'a mut self,
text_entities: Option<Vec<MessageEntity>>
) -> &'a mut Self
pub fn set_text_entities<'a>( &'a mut self, text_entities: Option<Vec<MessageEntity>> ) -> &'a mut Self
Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
sourcepub fn get_animation<'a>(&'a self) -> Option<Cow<'a, Animation>>
pub fn get_animation<'a>(&'a self) -> Option<Cow<'a, Animation>>
Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
sourcepub fn get_animation_ref<'a>(&'a self) -> Option<&'a Animation>
pub fn get_animation_ref<'a>(&'a self) -> Option<&'a Animation>
Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
sourcepub fn set_animation<'a>(
&'a mut self,
animation: Option<Animation>
) -> &'a mut Self
pub fn set_animation<'a>( &'a mut self, animation: Option<Animation> ) -> &'a mut Self
Optional. Animation that will be displayed in the game message in chats. Upload via BotFather