toggle_join_to_send()#

Client.toggle_join_to_send()#

Enable or disable guest users’ ability to send messages in a supergroup.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat.

  • enabled (bool) – The new status. Pass True to enable guest users to send message.

Returns:

bool – True on success. False otherwise.

Example

# Change status of guests sending messages to disabled
await app.toggle_join_to_send()

# Change status of guests sending messages to enabled
await app.toggle_join_to_send(enabled=True)