Link Search Menu Expand Document

Method: bots.toggleUsername

Back to methods index

Activate or deactivate a purchased username associated to a bot we own.


botUsername, chat ID, Update, Message or InputUserThe botOptional
activeBoolWhether to activate or deactivate itYes

Return type: Bool

Can bots use this method: YES

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('', 'madeline.php');
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');

$Bool = $MadelineProto->bots->toggleUsername(bot: $InputUser, username: 'string', active: $Bool, );