set_bot_default_privileges()

Client.set_bot_default_privileges()

Change the default privileges requested by the bot when it’s added as an administrator to groups or channels.

These privileges will be suggested to users, but they are are free to modify the list before adding the bot.

Usable by Users Bots
Parameters:
  • privileges (ChatPrivileges) – New default privileges. None to clear. Defaults to None.

  • for_channels (bool, optional) – Pass True to change the default privileges of the bot in channels. Otherwise, the default privileges of the bot for groups and supergroups will be changed.

Returns:

bool – On success, True is returned.

Example

from pyrogram.types import ChatPrivileges

await app.set_bot_default_privileges(
    ChatPrivileges(
        can_delete_messages=True,
        can_restrict_members=True
    )
)