bots.ToggleUsername

class pyrogram.raw.functions.bots.ToggleUsername

Activate or deactivate a purchased fragment.com username associated to a bot we own.

Details:
  • Layer: 223

  • ID: 53CA973

Parameters:
  • bot (InputUser) – The bot

  • username (str) – Username

  • active (bool) – Whether to activate or deactivate it

Returns:

bool

TL Schema

bots.toggleUsername#53ca973
bot:InputUser
username:string
active:Bool

= Bool

Parameter Tree

ToggleUsername
├── botInputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ └── InputUserFromMessage
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── user_idlong
├── usernamestring
└── activeBool

Example

await app.invoke(
    ToggleUsername(
        bot=await app.resolve_user(chat_id),
        username="text",
        active=True,
    )
)