send_game()

async Client.send_game()

Send a game.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat. For your personal cloud (Saved Messages) you can simply use “me” or “self”. For a contact that exists in your Telegram address book you can use his phone number (str).

  • game_short_name (str) – Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.

  • disable_notification (bool, optional) – Sends the message silently. Users will receive a notification with no sound.

  • reply_to_message_id (int, optional) – If the message is a reply, ID of the original message.

  • protect_content (bool, optional) – Protects the contents of the sent message from forwarding and saving.

  • reply_markup (InlineKeyboardMarkup, optional) – An object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown automatically. If not empty, the first button must launch the game.

  • effect_id (int, optional) – Unique identifier of the message effect to be added to the message.

  • allow_paid_broadcast (bool, optional) – Pass True to allow the message to be sent ignoring broadcasting limits, for a fee.

  • schedule_date (datetime, optional) – Date when the message will be automatically sent.

  • repeat_period (int, optional) – Period in seconds for the message to be sent repeatedly.

  • paid_message_star_count (int, optional) – The number of Telegram Stars the user agreed to pay to send the message.

  • suggested_post_parameters (SuggestedPostParameters, optional) – Parameters of the suggested post.

  • background (bool, optional) – Send the message in background.

  • clear_draft (bool, optional) – Clear the draft of the chat.

  • update_stickersets_order (bool, optional) – Move the sticker set to the top of the list.

  • send_as (int | str, optional) – Unique identifier (int) or username (str) of the chat or channel to send the message as.

  • quick_reply_shortcut (int, optional) – Unique identifier of the quick reply shortcut to use.

Returns:

Message – On success, the sent game message is returned.

Example

await app.send_game(chat_id, "gamename")