Skip to content

sendGame

Sahri Riza Umami edited this page Jun 22, 2018 · 4 revisions

Send a message with a game; not supported for channels or secret chats.

sendGame(chat_id, reply_to_message_id, bot_user_id, gameshortname, disable_notification, from_background, reply_markup, callback, data)
Field Type Description
chat_id int53 Target chat.
reply_to_message_id int53 Identifier of the message to reply to.
bot_user_id int32 User identifier of the bot that owns the game.
game_short_name string Short name of the game.
disable_notification Bool Pass true to disable notification for the message. Not supported in secret chats.
from_background Bool Pass true if the message is sent from the background.
reply_markup ReplyMarkup Markup for replying to the message; for bots only.

Example

  • Send message with a game Math Battle from bot id 166035794 to chat 1234567890.

    sendGame(1234567890, 0, 166035794, 'MathBattle')

    Response:

    {
      ["@type"] = "message",
      author_signature = "",
      can_be_deleted_for_all_users = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = false,
      can_be_forwarded = true,
      chat_id = "1234567890",
      contains_unread_mention = false,
      content = {
        ["@type"] = "messageGame",
        game = {
          ["@type"] = "game",
          description = "",
          id = "0",
          photo = {
            ["@type"] = "photo",
            has_stickers = false,
            id = "0",
            sizes = {}
          },
          short_name = "MathBattle",
          text = {
            ["@type"] = "formattedText",
            entities = {},
            text = ""
          },
          title = ""
        }
      },
      date = 1529659580,
      edit_date = 0,
      id = "16072572937",
      is_channel_post = false,
      is_outgoing = true,
      media_album_id = "0",
      reply_to_message_id = 0,
      sender_user_id = 44444444,
      sending_state = {
        ["@type"] = "messageSendingStatePending"
      },
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 166035794,
      views = 0
    }  

Frequently Asked Questions
The Functions

Clone this wiki locally