Skip to content

Action: chat member

Use this action to check if a user is a member of one or several channels or groups. If it's a channel, it's necessary for the bot to be an administrator of it, while for a group, being a member is sufficient. For more advanced details must be an administrator.

The total number of actions of this type that you can have simultaneously per bot, and the channels and groups that can be checked per action, depend on your current Subscription in VisualMaker.

Options of the action:

  • Set chats: The channels or groups in which to check if the user is a member, separated by commas. You can use expressions, variables, and IDs of previous actions to dynamically check chats.
  • Other user (optional): User to verify if they are a member of the specified chats. If not specified, it will verify the user who executed the action. You can use expressions, variables, and IDs of previous actions to dynamically set users.

What does the action return through its ID?

Access the verification result of each chat through its chat number with the format #IDAction.chat(num)#, replace IDAction with the ID of this action, and (num) with the chat number to verify, according to the order in which it was saved. For example, if you saved two channels separated by a comma: @channel_of_cats, @channel_of_dogs, access the user's status in @channel_of_cats through #IDAction.chat1.status#, and in @channel_of_dogs through #IDAction.chat2.status#. Don't forget to replace IDAction with the ID of this action.

Understanding the above, there is a lot of information you can obtain about the user's membership in the verified chat.

Parameters that can be obtained

  • status: The user's status in the verified chat, which can be member, administrator, owner, left, banned, or restricted.
  • joined_date: Date when the user joined the chat.
  • invited_by: ID of the user who invited the user to the chat via an invitation link.
  • promoted_by: If the user is an administrator of the chat, ID of the administrator who promoted them.
  • restricted_by: If the user is restricted or banned, ID of the administrator who restricted or banned them.
  • until_date: If the user is restricted or banned, until what date.
  • can_be_edited: Returns True if the user is allowed to edit the user's admin privileges, otherwise returns False.
  • privileges: Only if the user is an administrator or owner. Privileged actions that the user, as an administrator, can perform.
  • permissions: Only if the user is restricted or banned. Restricted actions that the user, if not an administrator, can perform.

Obtain user privileges

  • privileges.can_manage_chat: Returns True if the user can access chat events log, chat statistics, channel message statistics, see channel members, view anonymous admins in groups, and ignore slow mode. Includes any other admin privilege. Otherwise returns False.
  • privileges.can_delete_messages: Returns True if the user can delete messages from other users, otherwise returns False.
  • privileges.can_manage_video_chats: Only for groups. Returns True if the admin can manage videochats (also known as group calls), otherwise returns False.
  • privileges.can_restrict_members: Returns True if the user can restrict, ban, or unban chat members, otherwise returns False.
  • privileges.can_promote_members: Returns True if the user can add new admins with a subset of their own privileges or demote admins they have promoted, directly or indirectly (promoted by admins appointed by the user), otherwise returns False.
  • privileges.can_change_info: Returns True if the user can change the chat title, photo, and other settings, otherwise returns False.
  • privileges.can_post_messages: Only for channels. Returns True if the user can post messages in the channel, otherwise returns False.
  • privileges.can_edit_messages: Only for channels. Returns True if the user can edit messages from other users, otherwise returns False.
  • privileges.can_invite_users: Returns True if the user can invite new users to the chat, otherwise returns False.
  • privileges.can_pin_messages: Only for groups. Returns True if the user can pin messages, otherwise returns False.
  • privileges.is_anonymous: Returns True if the user is hidden in the chat, otherwise returns False.

Obtain user permissions

  • permissions.can_send_messages: Returns True if the user is allowed to send text messages, contacts, locations, and venues, otherwise returns False.
  • permissions.can_send_media_messages: Returns True if the user is allowed to send audios, documents, photos, videos, video notes, and voice notes. Includes can_send_messages. Otherwise returns False.
  • permissions.can_send_other_messages: Returns True if the user can send animations, games, stickers, and use inline bots. Includes can_send_media_messages. Otherwise returns False.
  • permissions.can_send_polls: Returns True if the user is permitted to send polls. Includes can_send_messages. Otherwise returns False.
  • permissions.can_add_web_page_previews: Returns True if the user can add web page previews to their messages. Includes can_send_media_messages. Otherwise returns False.
  • permissions.can_change_info: Returns True if the user can change the chat title, photo, and other settings. Ignored in public groups. Otherwise returns False.
  • permissions.can_invite_users: Returns True if the user can invite new users to the chat, otherwise returns False.
  • permissions.can_pin_messages: Returns True if the user can pin messages. Ignored in public groups. Otherwise returns False.
Guide

Need an example? We have a detailed guide where we walk you through step by step on how to require users to join certain channels when starting the bot, and only after joining can they continue. To view it click here.