peyk.platforms.bale.methods.restrict_chat_member

async peyk.platforms.bale.methods.restrict_chat_member(self, chat_id: int | str, user_id: int, permissions: ChatPermissions | Mapping[str, object]) → bool[source]

Restrict a member of a group or supergroup.

The bot must be an administrator with the right to restrict members. To lift a restriction, send the permissions you want the user to have (True).

Bale has no until_date: the restriction lasts until you lift it yourself, so a timed mute must be undone manually at the right time.

Parameters:
  • chat_id – Identifier of the target chat.

  • user_id – Identifier of the target user.

  • permissions – New permissions, as a ChatPermissions or a plain mapping.

Returns:

True when Bale accepted the request.

Return type:

bool

Raises:

BaleAPIError – If the Bale API rejects the request.

Example

await client.restrict_chat_member(chat_id, user_id, ChatPermissions(can_send_messages=False))