From 2b126a07558afc9a192040b7bfacbe829e305c9d Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 25 Feb 2018 10:17:45 +0000 Subject: [PATCH] Update docs.madelineproto.xyz --- docs/API_docs/types/KeyboardButton.md | 1 + docs/index.md | 22 +++++++++++++++++++ old_docs/API_docs_v33/types/KeyboardButton.md | 1 + old_docs/API_docs_v38/types/KeyboardButton.md | 1 + old_docs/API_docs_v40/types/KeyboardButton.md | 1 + old_docs/API_docs_v41/types/KeyboardButton.md | 1 + old_docs/API_docs_v42/types/KeyboardButton.md | 1 + old_docs/API_docs_v44/types/KeyboardButton.md | 1 + old_docs/API_docs_v45/types/KeyboardButton.md | 1 + old_docs/API_docs_v46/types/KeyboardButton.md | 1 + old_docs/API_docs_v51/types/KeyboardButton.md | 1 + old_docs/API_docs_v53/types/KeyboardButton.md | 1 + old_docs/API_docs_v55/types/KeyboardButton.md | 1 + old_docs/API_docs_v57/types/KeyboardButton.md | 1 + old_docs/API_docs_v62/types/KeyboardButton.md | 1 + old_docs/API_docs_v65/types/KeyboardButton.md | 1 + old_docs/API_docs_v66/types/KeyboardButton.md | 1 + old_docs/API_docs_v68/types/KeyboardButton.md | 1 + old_docs/API_docs_v70/types/KeyboardButton.md | 1 + old_docs/API_docs_v71/types/KeyboardButton.md | 1 + old_docs/API_docs_v72/types/KeyboardButton.md | 1 + old_docs/API_docs_v73/types/KeyboardButton.md | 1 + src/danog/MadelineProto/InternalDoc.php | 15 ++++++++++++- 23 files changed, 57 insertions(+), 1 deletion(-) diff --git a/docs/API_docs/types/KeyboardButton.md b/docs/API_docs/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/docs/API_docs/types/KeyboardButton.md +++ b/docs/API_docs/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/docs/index.md b/docs/index.md index 77d0866a..8b661907 100644 --- a/docs/index.md +++ b/docs/index.md @@ -69,6 +69,7 @@ This library can also be used to create lua telegram bots (like bot API bots, on * PFS in secret chats +* [Clickable inline buttons](#inline-buttons)! ## PHP Requirements @@ -178,6 +179,27 @@ You can find examples for nearly every MadelineProto function in * [`userbots/MadelineProto_bot.php`](https://github.com/danog/MadelineProto/blob/master/userbots/MadelineProto_bot.php) - More fun shiz * [`userbots/pwrtelegram_debug_bot`](https://github.com/danog/MadelineProto/blob/master/userbots/pwrtelegram_debug_bot.php) - More fun shiz +### Inline buttons + +You can easily click inline buttons using MadelineProto, just access the correct button: + +``` +$button = $update['update']['message']['reply_markup']['rows'][0]['buttons'][0]; +``` + +You can then access properties (they vary depending on the [type of button](https://docs.madelineproto.xyz/API_docs/types/KeyboardButton.html)): + +``` +$text = $button['text']; +``` + +And click them: + +``` +$button->click(); +``` + + ### Storing sessions To store information about an account session, serialization must be done. diff --git a/old_docs/API_docs_v33/types/KeyboardButton.md b/old_docs/API_docs_v33/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v33/types/KeyboardButton.md +++ b/old_docs/API_docs_v33/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v38/types/KeyboardButton.md b/old_docs/API_docs_v38/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v38/types/KeyboardButton.md +++ b/old_docs/API_docs_v38/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v40/types/KeyboardButton.md b/old_docs/API_docs_v40/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v40/types/KeyboardButton.md +++ b/old_docs/API_docs_v40/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v41/types/KeyboardButton.md b/old_docs/API_docs_v41/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v41/types/KeyboardButton.md +++ b/old_docs/API_docs_v41/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v42/types/KeyboardButton.md b/old_docs/API_docs_v42/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v42/types/KeyboardButton.md +++ b/old_docs/API_docs_v42/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v44/types/KeyboardButton.md b/old_docs/API_docs_v44/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v44/types/KeyboardButton.md +++ b/old_docs/API_docs_v44/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v45/types/KeyboardButton.md b/old_docs/API_docs_v45/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v45/types/KeyboardButton.md +++ b/old_docs/API_docs_v45/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v46/types/KeyboardButton.md b/old_docs/API_docs_v46/types/KeyboardButton.md index 290cbd4e..9bf7b4fc 100644 --- a/old_docs/API_docs_v46/types/KeyboardButton.md +++ b/old_docs/API_docs_v46/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v51/types/KeyboardButton.md b/old_docs/API_docs_v51/types/KeyboardButton.md index 4e2ba1b6..ac965049 100644 --- a/old_docs/API_docs_v51/types/KeyboardButton.md +++ b/old_docs/API_docs_v51/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v53/types/KeyboardButton.md b/old_docs/API_docs_v53/types/KeyboardButton.md index 4e2ba1b6..ac965049 100644 --- a/old_docs/API_docs_v53/types/KeyboardButton.md +++ b/old_docs/API_docs_v53/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v55/types/KeyboardButton.md b/old_docs/API_docs_v55/types/KeyboardButton.md index 4e2ba1b6..ac965049 100644 --- a/old_docs/API_docs_v55/types/KeyboardButton.md +++ b/old_docs/API_docs_v55/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v57/types/KeyboardButton.md b/old_docs/API_docs_v57/types/KeyboardButton.md index 717fb2ad..af62694c 100644 --- a/old_docs/API_docs_v57/types/KeyboardButton.md +++ b/old_docs/API_docs_v57/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v62/types/KeyboardButton.md b/old_docs/API_docs_v62/types/KeyboardButton.md index 717fb2ad..af62694c 100644 --- a/old_docs/API_docs_v62/types/KeyboardButton.md +++ b/old_docs/API_docs_v62/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v65/types/KeyboardButton.md b/old_docs/API_docs_v65/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v65/types/KeyboardButton.md +++ b/old_docs/API_docs_v65/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v66/types/KeyboardButton.md b/old_docs/API_docs_v66/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v66/types/KeyboardButton.md +++ b/old_docs/API_docs_v66/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v68/types/KeyboardButton.md b/old_docs/API_docs_v68/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v68/types/KeyboardButton.md +++ b/old_docs/API_docs_v68/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v70/types/KeyboardButton.md b/old_docs/API_docs_v70/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v70/types/KeyboardButton.md +++ b/old_docs/API_docs_v70/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v71/types/KeyboardButton.md b/old_docs/API_docs_v71/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v71/types/KeyboardButton.md +++ b/old_docs/API_docs_v71/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v72/types/KeyboardButton.md b/old_docs/API_docs_v72/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v72/types/KeyboardButton.md +++ b/old_docs/API_docs_v72/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/old_docs/API_docs_v73/types/KeyboardButton.md b/old_docs/API_docs_v73/types/KeyboardButton.md index c4c37576..7fd00b94 100644 --- a/old_docs/API_docs_v73/types/KeyboardButton.md +++ b/old_docs/API_docs_v73/types/KeyboardButton.md @@ -27,6 +27,7 @@ $result = $KeyboardButton->click(); * `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](../constructors/keyboardButton.md) diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php index a110a179..0f7bc892 100644 --- a/src/danog/MadelineProto/InternalDoc.php +++ b/src/danog/MadelineProto/InternalDoc.php @@ -1,5 +1,4 @@