telegram api method · layer 229 · #10e6bd2c

channels.checkUsername

usable by users

Check if a username is free and can be assigned to a channel/supergroup

definition

channels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;

parameters

nametypedescription
channelInputChannelThe channel/supergroup that will assigned the specified username
usernamestringThe username to check

returns

Bool

errors (11)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHANNELS_ADMIN_PUBLIC_TOO_MUCHYou're admin of too many public channels, make some channels private to change the username of this channel.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
400USERNAME_INVALIDThe provided username is not valid.
400USERNAME_OCCUPIEDThe provided username is already occupied.
400USERNAME_PURCHASE_AVAILABLEThe specified username can be purchased on https://fragment.com.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).

history

present in layers 46–229

idlayers
#10e6bd2c46–229