Link Search Menu Expand Document

Method: bots.setBotMenuButton

Back to methods index

Sets the menu button action » for a given user or for all users

Parameters:

NameTypeDescriptionRequired
user_idUsername, chat ID, Update, Message or InputUserUser IDOptional
buttonBotMenuButtonBot menu button actionYes

Return type: Bool

Can bots use this method: YES

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

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

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

$Bool = $MadelineProto->bots->setBotMenuButton(user_id: $InputUser, button: $BotMenuButton, );