botnest
Documentation
Guide

Telegram members and join requests

Permissions, bans, member details and joining a chat.

Before configuring

  1. Use the correct chat and member ID; a username is not a numeric user ID.
  2. Check the bot's own permissions.
  3. Check who requested an action before changing permissions or banning someone.

A user and a sender channel are different authors. A message sent as a channel requires sender-chat actions rather than user actions.

These blocks are for Telegram. Test them in a test group first.

Security →

Ban member

Bans a member from a chat.

  1. Set the chat and user ID. Configure a duration and message removal if needed.
  2. Check the ID and administrator permissions. Use Remove member for removal without a continuing entry ban.

Remove member

Removes a member without leaving a permanent re-entry ban.

  1. Set the chat and user ID.
  2. The person can return through an available entry method. Use Ban member to prohibit re-entry.

Unban member

Removes a member's ban.

  1. Set the chat and user ID. Check the only-if-banned setting.
  2. Unbanning permits a return; it does not automatically add the person back to the chat.

Restrict member

Changes one member's permissions, such as preventing them from sending messages.

  1. Set the chat, user, permissions and an optional restriction duration.
  2. This affects that member, not the whole chat. Use Set chat permissions for shared rules.

Promote administrator

Promotes a member to administrator with selected permissions.

  1. Set the chat, user and only the permissions they need.
  2. The bot must be allowed to appoint administrators. Do not grant permissions based on unchecked user input.

Demote administrator

Removes a member's administrator permissions.

  1. Set the chat and administrator's user ID.
  2. The bot cannot change every administrator: Telegram's permission hierarchy and restrictions apply.

Set administrator title

Changes the title displayed for an administrator.

  1. Set the chat, user and title text.
  2. The title does not change permissions. Grant permissions with a separate block.

Set member tag

Changes a member's tag in a chat.

  1. Set the chat, user and tag.
  2. Check tag support in the chat and the bot's permissions. This does not rename the Telegram account.

Ban sender channel

Bans a selected sender channel or chat from posting in the target chat.

  1. Set the target chat and sender chat ID.
  2. A sender channel ID is different from a user ID. Check who the message was sent as.

Unban sender channel

Lifts a posting ban on a selected sender channel or chat.

  1. Set the target chat and banned sender chat ID.
  2. Use Unban member to unblock an ordinary user.

Approve join request

Approves a user's request to join a chat.

  1. Supply the chat and user from the Join request event.
  2. Add a condition first if not every request should be accepted. The bot needs permission to handle join requests.

Decline join request

Declines a join request.

  1. Set the chat and user from the request.
  2. The rejection applies to this request. Use a separate block to ban the user.

Answer join request query

Answers a special join request query using its query ID.

  1. Supply chat_join_request_query_id and the response result.
  2. This ID is not a user ID. Use Approve join request for ordinary approval.

Send join request Web App

Sends a Web App in response to a special join request query.

  1. Set the query ID and app URL.
  2. Use data from a matching event. This is not an ordinary app button in a message.

Get member

Gets a member's details and status in a chat.

  1. Set the chat and user ID.
  2. Pass the result to a condition to check membership or role. Available data depends on the bot's permissions.

Get member boosts

Gets a selected user's boosts for a chat.

  1. Set the chat and user.
  2. Check the result before awarding a benefit. No boosts should be handled as a normal branch.