setMyDefaultAdministratorRights#

Returns: bool

class aiogram.methods.set_my_default_administrator_rights.SetMyDefaultAdministratorRights(*, rights: ChatAdministratorRights | None = None, for_channels: bool | None = None, **extra_data: Any)[source]#

Use this method to change the default administrator rights requested by the bot when it’s added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.

Source: https://core.telegram.org/bots/api#setmydefaultadministratorrights

rights: ChatAdministratorRights | None#

A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_post_init(_ModelMetaclass__context: Any) None#

We need to both initialize private attributes and call the user-defined model_post_init method.

for_channels: bool | None#

Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.

Usage#

As bot method#

result: bool = await bot.set_my_default_administrator_rights(...)

Method as object#

Imports:

  • from aiogram.methods.set_my_default_administrator_rights import SetMyDefaultAdministratorRights

  • alias: from aiogram.methods import SetMyDefaultAdministratorRights

With specific bot#

result: bool = await bot(SetMyDefaultAdministratorRights(...))

As reply into Webhook in handler#

return SetMyDefaultAdministratorRights(...)