pub struct Game {
pub title: String,
pub description: String,
pub photo: Vec<PhotoSize>,
pub text: Option<String>,
pub text_entities: Option<Vec<MessageEntity>>,
pub animation: Option<BoxWrapper<Unbox<Animation>>>,
}Expand description
This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
Fields§
§title: StringTitle of the game
description: StringDescription of the game
photo: Vec<PhotoSize>Photo that will be displayed in the game message in chats.
text: Option<String>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.
text_entities: Option<Vec<MessageEntity>>Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
animation: Option<BoxWrapper<Unbox<Animation>>>Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
Implementations§
Source§impl Game
impl Game
pub fn new(title: String, description: String, photo: Vec<PhotoSize>) -> Self
Sourcepub fn get_description<'a>(&'a self) -> &'a str
pub fn get_description<'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) -> &'a Vec<PhotoSize>
pub fn get_photo<'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<&'a str>
pub fn get_text<'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<&'a Vec<MessageEntity>>
pub fn get_text_entities<'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<&'a Animation>
pub fn get_animation<'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
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Game
impl<'de> Deserialize<'de> for Game
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<NoSkipGame> for Game
impl From<NoSkipGame> for Game
Source§fn from(t: NoSkipGame) -> Self
fn from(t: NoSkipGame) -> Self
Source§impl Into<NoSkipGame> for Game
impl Into<NoSkipGame> for Game
Source§fn into(self) -> NoSkipGame
fn into(self) -> NoSkipGame
Source§impl Ord for Game
impl Ord for Game
Source§impl PartialOrd for Game
impl PartialOrd for Game
impl Eq for Game
impl StructuralPartialEq for Game
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnsafeUnpin for Game
impl UnwindSafe for Game
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.