toggle_bot_in_attach_menu()

async Client.toggle_bot_in_attach_menu()

Enable or disable a bot in the attach menu.

Usable by Users Bots
Parameters:
  • bot_id (int | str) – The bot user ID or username.

  • enabled (bool) – Pass True to enable, False to disable.

  • write_allowed (bool, optional) – If True, allow the bot to send messages.

Returns:

bool – True on success.

Example

await app.toggle_bot_in_attach_menu("@mybot", enabled=True)