channels.ToggleUsername

class pyrogram.raw.functions.channels.ToggleUsername

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

Details:
  • Layer: 223

  • ID: 50F24105

Parameters:
  • channel (InputChannel) – Supergroup or channel

  • username (str) – Username

  • active (bool) – Whether to activate or deactivate the username

Returns:

bool

TL Schema

channels.toggleUsername#50f24105
channel:InputChannel
username:string
active:Bool

= Bool

Parameter Tree

ToggleUsername
├── channelInputChannel
│ ├── InputChannelEmpty
│ ├── InputChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── usernamestring
└── activeBool

Example

await app.invoke(
    ToggleUsername(
        channel=await app.resolve_channel(chat_id),
        username="text",
        active=True,
    )
)