2018-04-01 13:19:25 +02:00
---
title: KeyboardButton
description: constructors and methods of type KeyboardButton
2018-04-04 19:52:48 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
2018-04-01 13:19:25 +02:00
---
2020-10-01 18:05:42 +02:00
# Type: KeyboardButton
2018-04-01 13:19:25 +02:00
[Back to types index ](index.md )
Clicking these buttons:
To click these buttons simply run the `click` method:
2020-10-01 18:05:42 +02:00
```php
2018-04-01 13:19:25 +02:00
$result = $KeyboardButton->click();
```
`$result` can be one of the following:
* A string - If the button is a keyboardButtonUrl
* [Updates ](Updates.md ) - If the button is a keyboardButton, the message will be sent to the chat, in reply to the message with the keyboard
2019-12-27 17:48:04 +01:00
* [messages.BotCallbackAnswer ](messages.BotCallbackAnswer.md ) - If the button is a keyboardButtonCallback or a keyboardButtonGame the button will be pressed and the result will be returned
2018-04-01 13:19:25 +02:00
* `false` - If the button is an unsupported button, like keyboardButtonRequestPhone, keyboardButtonRequestGeoLocation, keyboardButtonSwitchInlinekeyboardButtonBuy; you will have to parse data from these buttons manually
2020-10-01 18:05:42 +02:00
You can also access the properties of the constructor as a normal array, for example `$button['name']`
2018-04-01 13:19:25 +02:00
### Possible values (constructors):
[keyboardButton ](../constructors/keyboardButton.md )
2020-10-01 18:05:42 +02:00
[keyboardButtonUrl ](../constructors/keyboardButtonUrl.md )
[keyboardButtonCallback ](../constructors/keyboardButtonCallback.md )
[keyboardButtonRequestPhone ](../constructors/keyboardButtonRequestPhone.md )
[keyboardButtonRequestGeoLocation ](../constructors/keyboardButtonRequestGeoLocation.md )
[keyboardButtonSwitchInline ](../constructors/keyboardButtonSwitchInline.md )
[keyboardButtonGame ](../constructors/keyboardButtonGame.md )
[keyboardButtonBuy ](../constructors/keyboardButtonBuy.md )
[keyboardButtonUrlAuth ](../constructors/keyboardButtonUrlAuth.md )
[inputKeyboardButtonUrlAuth ](../constructors/inputKeyboardButtonUrlAuth.md )
[keyboardButtonRequestPoll ](../constructors/keyboardButtonRequestPoll.md )
2018-04-01 13:19:25 +02:00
### Methods that return an object of this type (methods):
2020-10-01 18:05:42 +02:00
[keyboardButton ](../constructors/keyboardButton.md )
[keyboardButtonUrl ](../constructors/keyboardButtonUrl.md )
[keyboardButtonCallback ](../constructors/keyboardButtonCallback.md )
[keyboardButtonRequestPhone ](../constructors/keyboardButtonRequestPhone.md )
[keyboardButtonRequestGeoLocation ](../constructors/keyboardButtonRequestGeoLocation.md )
[keyboardButtonSwitchInline ](../constructors/keyboardButtonSwitchInline.md )
[keyboardButtonGame ](../constructors/keyboardButtonGame.md )
[keyboardButtonBuy ](../constructors/keyboardButtonBuy.md )
[keyboardButtonUrlAuth ](../constructors/keyboardButtonUrlAuth.md )
[inputKeyboardButtonUrlAuth ](../constructors/inputKeyboardButtonUrlAuth.md )
[keyboardButtonRequestPoll ](../constructors/keyboardButtonRequestPoll.md )