Skip to content

getChatMessageByDate

Sahri Riza Umami edited this page Jun 24, 2018 · 1 revision

Returns the last message sent in a chat no later than the specified date.

getChatMessageByDate(chat_id, date, callback, data)
Field Type Description
chat_id int53 Chat identifier.
date int32 Point in time (Unix timestamp) relative to which to search for messages.

Example

  • Get the last message sent in chat 1234567890 no later than 24 June 2018.

    getChatMessageByDate(1234567890, 1529813532)

    Response:

    {
      ["@type"] = "message",
      author_signature = "",
      can_be_deleted_for_all_users = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = true,
      can_be_forwarded = true,
      chat_id = "1234567890",
      contains_unread_mention = false,
      content = {
        ["@type"] = "messageText",
        text = {
          ["@type"] = "formattedText",
          entities = {},
          text = "testt"
        }
      },
      date = 1529813532,
      edit_date = 0,
      id = "16092495872",
      is_channel_post = false,
      is_outgoing = true,
      media_album_id = "0",
      reply_to_message_id = 0,
      sender_user_id = 66666666,
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    }  

Frequently Asked Questions
The Functions

Clone this wiki locally