Skip to content

getCommonChats

Sahri Riza Umami edited this page Jun 10, 2017 · 6 revisions

Returns list of common chats with an other given user.

getCommonChats(user_id, offset_chat_id, limit)

Chats are sorted by their type and creation date.

Option Description
user_id User identifier.
offset_chat_id Chat identifier to return chats from, use 0 for the first request.
limit Maximum number of chats to be returned, up to 100

Example

  • List 20 common chats with 345829823.

    getCommonChats(345829823, 0, 20)

    Response:

    {
      ID = "Chats",
      chats_ = {
        {
          ... REDACTED to keep it short ...
        },
        [0] = {
          ID = "Chat",
          draft_message_ = false,
          id_ = "-1001138736494",
          last_read_inbox_message_id_ = 40894464,
          last_read_outbox_message_id_ = 29360128,
          notification_settings_ = {
            ID = "NotificationSettings",
            mute_for_ = 650356186,
            show_preview_ = true,
            sound_ = "default"
          },
          order_ = "6430110154338861095",
          photo_ = {
            ID = "ChatPhoto",
            big_ = {
              ID = "File",
              id_ = 8,
              path_ = false,
              persistent_id_ = "AQADBQATd0jKMgAEHCCUeH11Zn1FigMAAQI",
              size_ = 0
            },
            small_ = {
              ID = "File",
              id_ = 7,
              path_ = false,
              persistent_id_ = "AQADBQATd0jKMgAEWXgnc8BRCJZDigMAAQI",
              size_ = 0
            }
          },
          reply_markup_message_id_ = 0,
          title_ = "My New Chat Title",
          top_message_ = {
            ID = "Message",
            can_be_deleted_ = true,
            can_be_edited_ = true,
            chat_id_ = "-1001138736494",
            content_ = {
              ID = "MessageText",
              entities_ = {},
              text_ = "pang",
              web_page_ = false
            },
            date_ = 1497126686,
            edit_date_ = 0,
            forward_info_ = false,
            id_ = 40894464,
            is_post_ = false,
            reply_markup_ = false,
            reply_to_message_id_ = 0,
            send_state_ = {
              ID = "MessageIsSuccessfullySent"
            },
            sender_user_id_ = 194211431,
            ttl_ = 0,
            ttl_expires_in_ = 0,
            via_bot_user_id_ = 0,
            views_ = 0
          },
          type_ = {
            ID = "ChannelChatInfo",
            channel_ = {
              ID = "Channel",
              anyone_can_invite_ = false,
              date_ = 1496994884,
              id_ = 1138736494,
              is_supergroup_ = true,
              is_verified_ = false,
              restriction_reason_ = false,
              sign_messages_ = true,
              status_ = {
                ID = "ChatMemberStatusCreator"
              },
              username_ = false
            }
          },
          unread_count_ = 0
        }
      }
    }

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally