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) -> Game
pub fn new<A, B, C>(description: A, photo: B, title: C) -> Game
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) -> Game
pub fn with_animation(self, value: Animation) -> Game
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<Game, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Game, <__D as Deserializer<'de>>::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 moresource§impl Serialize for Game
impl Serialize for Game
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more