Skip to content

searchCallMessages

Sahri Riza Umami edited this page Jul 1, 2018 · 4 revisions

Searches for call messages.
Returns the results in reverse chronological order (i. e., in order of decreasing message_id).
For optimal performance the number of returned messages is chosen by the library.

searchCallMessages(from_message_id, limit, only_missed, callback, data)
Field Type Description
from_message_id int53 Identifier of the message from which to search; use 0 to get results from the beginning.
limit int32 The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.
only_missed Bool If true, returns only messages with missed calls.

Example

  • Searches from the beginning for 3 call messages.

    searchCallMessages(0, 3)

    Response:

    {
      ["@type"] = "messages",
      messages = {
        {
          ["@type"] = "message",
          author_signature = "",
          can_be_deleted_for_all_users = false,
          can_be_deleted_only_for_self = true,
          can_be_edited = false,
          can_be_forwarded = false,
          chat_id = 123454321,
          contains_unread_mention = false,
          content = {
            ["@type"] = "messageCall",
            discard_reason = {
              ["@type"] = "callDiscardReasonHungUp"
            },
            duration = 7
          },
          date = 1518334638,
          edit_date = 0,
          id = "1761855143936",
          is_channel_post = false,
          is_outgoing = true,
          media_album_id = "0",
          reply_to_message_id = 0,
          sender_user_id = 999999999,
          ttl = 0,
          ttl_expires_in = 0,
          via_bot_user_id = 0,
          views = 0
        },
        {
          ["@type"] = "message",
          author_signature = "",
          can_be_deleted_for_all_users = false,
          can_be_deleted_only_for_self = true,
          can_be_edited = false,
          can_be_forwarded = false,
          chat_id = 1234567890,
          contains_unread_mention = false,
          content = {
            ["@type"] = "messageCall",
            discard_reason = {
              ["@type"] = "callDiscardReasonHungUp"
            },
            duration = 2
          },
          date = 1518334322,
          edit_date = 0,
          id = "1761853046784",
          is_channel_post = false,
          is_outgoing = true,
          media_album_id = "0",
          reply_to_message_id = 0,
          sender_user_id = 99999999,
          ttl = 0,
          ttl_expires_in = 0,
          via_bot_user_id = 0,
          views = 0
        }
      },
      total_count = 48
    }

Frequently Asked Questions
The Functions

Clone this wiki locally