Layer 220
method Users
account.toggleUsername#58d6b376 username:string active:Bool = Bool;

Parameters

Name Type Description
Username string Username
Active Bool Whether to activate or deactivate it

Returns

Bool

Possible Errors

Code Type Description
400 USERNAMES_ACTIVE_TOO_MUCH The maximum number of active usernames was reached.
400 USERNAME_INVALID The provided username is not valid.
400 USERNAME_NOT_MODIFIED The username was not modified.

Gogram Example

// AccountToggleUsername - positional arguments
result, err := client.AccountToggleUsername("...", true)
if err != nil {
    // handle error
}
// result is *tg.Bool