Skip to content

searchChatMembers

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

Searches for a specified query in the first name, last name and username of the members of a specified chat.
Requires administrator rights in channels.

searchChatMembers(chat_id, query, limit, callback, data)
Field Type Description
chat_id int53 Chat identifier.
query string Query to search for.
limit int32 The maximum number of users to be returned.

Example

  • Searches "@merbot" among members of chat 1234567890. Limit search result to 1.

    searchChatMembers(1234567890, 'merbot', 1)

    Response:

    {
      ["@type"] = "chatMembers",
      members = {
        {
          ["@type"] = "chatMember",
          bot_info = {
            ["@type"] = "botInfo",
            commands = {},
            description = ""
          },
          inviter_user_id = 133780085,
          joined_chat_date = 1521287680,
          status = {
            ["@type"] = "chatMemberStatusAdministrator",
            can_be_edited = false,
            can_change_info = true,
            can_delete_messages = true,
            can_edit_messages = false,
            can_invite_users = true,
            can_pin_messages = true,
            can_post_messages = false,
            can_promote_members = false,
            can_restrict_members = true
          },
          user_id = 317109726
        }
      },
      total_count = 1
    }

Frequently Asked Questions
The Functions

Clone this wiki locally