toggle_forum_topics()

Client.toggle_forum_topics()

Enable or disable forum functionality in a supergroup.

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

  • is_forum (bool) – The new status. Pass True to enable forum topics. Defaults to False.

  • has_forum_tabs (bool) – Whether to enable or disable tabs in the forum. Defaults to False.

Returns:

bool – True on success. False otherwise.

Example

# Change status of topics to disabled
await app.toggle_forum_topics(is_forum=False)

# Change status of topics to enabled
await app.toggle_forum_topics(is_forum=True)