MAX icon

MAX

Отправка сообщений и работа с API мессенджера MAX

Участники чата → Удалить участника

AI-generated

Summary

Removes a user from a MAX group chat by sending a DELETE request to the MAX platform API, optionally blocking the user from rejoining.

Inputs

  • ID чата (membersChatId) (required) — ID of the group chat the user is removed from. Inserted into the request URL.
  • ID пользователя (memberUserId) (required) — ID of the user to remove. The value is trimmed and parsed as an integer, so non-numeric input becomes NaN and the request is sent with an invalid user_id.
  • Заблокировать пользователя (memberBlock) — Boolean, default false. When true, the request adds block=true so the user is also blocked in the chat after removal.

Output shape

One output item per input item. Its json is the raw response body from the MAX API for DELETE /chats/{chatId}/members?user_id=…[&block=true].

The source doesn't transform the response. MAX typically returns a success status object, but the exact fields aren't defined in this code. If 'Continue on Fail' is enabled, a failed item returns {error: message}. Otherwise the node throws. The bot needs permission to remove members in that chat.

Examples

Example 1: Remove a user from a group chat

ID чата = -70931657203722, ID пользователя = 12345, Заблокировать = false

Example 2: Ban a spammer reported by an earlier node

ID чата = {{ $json.chat_id }}, ID пользователя = {{ $json.user_id }}, Заблокировать = true

Links

Discussion