pub struct Game {
pub description: String,
pub photo: Vec<PhotoSize>,
pub title: String,
pub animation: Option<Animation>,
pub text: Option<Text>,
}
Expand description
Represents a Game.
Use BotFather to create and edit games, their short names will act as unique identifiers.
Fields§
§description: String
Description of the game.
photo: Vec<PhotoSize>
Photo that will be displayed in the game message in chats.
title: String
Title of the game.
animation: Option<Animation>
Animation that will be displayed in the game message in chats.
Upload via BotFather.
text: Option<Text>
Brief description or high scores included in the game message; 0-4096 characters.
Can be automatically edited to include current high scores for
when the bot calls SetGameScore
,
or manually edited using crate::types::EditMessageText
.
Implementations§
source§impl Game
impl Game
sourcepub fn new<A, B, C>(description: A, photo: B, title: C) -> Self
pub fn new<A, B, C>(description: A, photo: B, title: C) -> Self
Creates a new Game
.
§Arguments
description
- Description of the game.photo
- Photo of the game.title
- Title of the game.
sourcepub fn with_animation(self, value: Animation) -> Self
pub fn with_animation(self, value: Animation) -> Self
Sets a new animation.
§Arguments
value
- Animation that will be displayed in the game message in chats.
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Game> for ExternalReplyData
impl From<Game> for ExternalReplyData
source§fn from(original: Game) -> ExternalReplyData
fn from(original: Game) -> ExternalReplyData
Converts to this type from the input type.
source§impl PartialEq for Game
impl PartialEq for Game
source§impl PartialOrd for Game
impl PartialOrd for Game
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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 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
Mutably borrows from an owned value. Read more