setMyName#

Returns: bool

class aiogram.methods.set_my_name.SetMyName(*, name: str | None = None, language_code: str | None = None, **extra_data: Any)[source]#

Use this method to change the bot’s name. Returns True on success.

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

name: str | None#

New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.

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.

language_code: str | None#

A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.

Usage#

As bot method#

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

Method as object#

Imports:

  • from aiogram.methods.set_my_name import SetMyName

  • alias: from aiogram.methods import SetMyName

With specific bot#

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

As reply into Webhook in handler#

return SetMyName(...)