channels.toggleUsername #

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

Layer 223

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;

Parameters #

NameTypeDescription
channelInputChannelSupergroup or channel
usernamestringUsername
activeBoolWhether to activate or deactivate the username

Result #

Bool

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
400USERNAMES_ACTIVE_TOO_MUCHThe maximum number of active usernames was reached.
400USERNAME_INVALIDThe provided username is not valid.
400USERNAME_NOT_MODIFIEDThe username was not modified.

Channels, supergroups, gigagroups and basic groups #

How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.