Skip to content

getMessages

Sahri Riza Umami edited this page Sep 21, 2017 · 6 revisions

Returns information about messages.
If message is not found, returns null on the corresponding position of the result.

getMessages(chat_id, message_ids)
Field Type Description
chat_id int53 Identifier of the chat, messages belongs to
message_ids vector Identifiers of the messages to get

Example

  • Get information about messages 13682868224, 13683916800, and 13684965376 in chat 1234567890.
getMessages(1234567890, 13682868224, 13683916800, 13684965376)

Response:

{
  _ = "messages",
  messages = {
    {
      _ = "message",
      author_signature = "",
      can_be_deleted_for_everyone = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = true,
      can_be_forwarded = true,
      chat_id = "-1001096508210",
      content = {
        _ = "messageText",
        entities = {},
        text = "DUA"
      },
      date = 1504320375,
      edit_date = 0,
      id = "13683916800",
      is_post = false,
      reply_to_message_id = 0,
      send_state = {
        _ = "messageIsSuccessfullySent"
      },
      sender_user_id = 371233995,
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    },
    {
      _ = "message",
      author_signature = "",
      can_be_deleted_for_everyone = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = true,
      can_be_forwarded = true,
      chat_id = "-1001096508210",
      content = {
        _ = "messageText",
        entities = {},
        text = "TIGA"
      },
      date = 1504320377,
      edit_date = 0,
      id = "13684965376",
      is_post = false,
      reply_to_message_id = 0,
      send_state = {
        _ = "messageIsSuccessfullySent"
      },
      sender_user_id = 371233995,
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    },
    [0] = {
      _ = "message",
      author_signature = "",
      can_be_deleted_for_everyone = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = true,
      can_be_forwarded = true,
      chat_id = "-1001096508210",
      content = {
        _ = "messageText",
        entities = {},
        text = "SATU"
      },
      date = 1504320365,
      edit_date = 0,
      id = "13682868224",
      is_post = false,
      reply_to_message_id = 0,
      send_state = {
        _ = "messageIsSuccessfullySent"
      },
      sender_user_id = 371233995,
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    }
  },
  total_count = 3
}

Frequently Asked Questions
The Functions

Clone this wiki locally