MadelineProtoDocs/old_docs/API_docs_v5/types/KeyboardButton.md

1.3 KiB

title description image
KeyboardButton constructors and methods of type KeyboardButton https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png

Type: KeyboardButton

Back to types index

Clicking these buttons:

To click these buttons simply run the click method:

$result = $KeyboardButton->click();

$result can be one of the following:

  • A string - If the button is a keyboardButtonUrl

  • Updates - If the button is a keyboardButton, the message will be sent to the chat, in reply to the message with the keyboard

  • messages.BotCallbackAnswer - If the button is a keyboardButtonCallback or a keyboardButtonGame the button will be pressed and the result will be returned

  • false - If the button is an unsupported button, like keyboardButtonRequestPhone, keyboardButtonRequestGeoLocation, keyboardButtonSwitchInlinekeyboardButtonBuy; you will have to parse data from these buttons manually

You can also access the properties of the constructor as a normal array, for example $button['name']

Possible values (constructors):

keyboardButton

Methods that return an object of this type (methods):

keyboardButton