channels.UpdateUsername

class pyrogram.raw.functions.channels.UpdateUsername

Change or remove the username of a supergroup/channel

Details:
  • Layer: 223

  • ID: 3514B3DE

Parameters:
  • channel (InputChannel) – Channel

  • username (str) – New username, pass an empty string to remove the username

Returns:

bool

TL Schema

channels.updateUsername#3514b3de
channel:InputChannel
username:string

= Bool

Parameter Tree

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

Example

await app.invoke(
    UpdateUsername(
        channel=await app.resolve_channel(chat_id),
        username="text",
    )
)