channels.UpdateUsername

class pyrogram.raw.functions.channels.UpdateUsername

Change or remove the username of a supergroup/channel

Details:
  • Layer: 227

  • 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
├── channel → InputChannel
│ ├── InputChannelEmpty
│ ├── InputChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
└── username → string

Example

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