peyk.platforms.telegram.types.game

Classes

Game(title, description, photo[, text, ...])

This object represents a game.

class peyk.platforms.telegram.types.game.Game(title: str, description: str, photo: List[PhotoSize], text: str | None = None, text_entities: List[MessageEntity] | None = None, animation: Animation | None = None)[source]

Bases: object

This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

Variables:
  • title (str) – Title of the game

  • description (str) – Description of the game

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize]) – Photo that will be displayed in the game message in chats

  • text (str | None) – 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 (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in text, such as usernames, URLs, bot commands, etc.

  • animation (peyk.platforms.telegram.types.animation.Animation | None) – Animation that will be displayed in the game message in chats. Upload via BotFather.

title: str
description: str
photo: List[PhotoSize]
text: str | None = None
text_entities: List[MessageEntity] | None = None
animation: Animation | None = None
classmethod from_dict(data: dict | None) Game | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.