Documentation fixes
This commit is contained in:
parent
5bc6fdc05f
commit
b97959b6c9
@ -443,6 +443,8 @@ Methods that allow sending message entities (messages.sendMessage for example) a
|
|||||||
|
|
||||||
To convert the results of methods to bot API objects you must provide a second parameter to method wrappers, containing an array with the `botAPI` key set to true.
|
To convert the results of methods to bot API objects you must provide a second parameter to method wrappers, containing an array with the `botAPI` key set to true.
|
||||||
|
|
||||||
|
reply_markup accepts bot API reply markup objects as well as MTProto ones.
|
||||||
|
|
||||||
Note that when you login as a bot, MadelineProto also logins using the [PWRTelegram](https://pwrtelegram.xyz) API, to allow persistant storage of peers, even after a logout and another login.
|
Note that when you login as a bot, MadelineProto also logins using the [PWRTelegram](https://pwrtelegram.xyz) API, to allow persistant storage of peers, even after a logout and another login.
|
||||||
|
|
||||||
### Storing sessions
|
### Storing sessions
|
||||||
|
@ -136,6 +136,7 @@ description: '.$this->settings['description'].'
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hasentities = false;
|
$hasentities = false;
|
||||||
|
$hasreplymarkup = false;
|
||||||
foreach ($this->methods->params[$key] as $param) {
|
foreach ($this->methods->params[$key] as $param) {
|
||||||
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
|
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
|
||||||
continue;
|
continue;
|
||||||
@ -161,6 +162,9 @@ description: '.$this->settings['description'].'
|
|||||||
$params .= (isset($param['subtype']) ? '['.$ptype.']' : $ptype).', ';
|
$params .= (isset($param['subtype']) ? '['.$ptype.']' : $ptype).', ';
|
||||||
$lua_params .= $param['name'].'=';
|
$lua_params .= $param['name'].'=';
|
||||||
$lua_params .= (isset($param['subtype']) ? '{'.$ptype.'}' : $ptype).', ';
|
$lua_params .= (isset($param['subtype']) ? '{'.$ptype.'}' : $ptype).', ';
|
||||||
|
if ($param['name'] === 'reply_markup') {
|
||||||
|
$hasreplymarkup = true;
|
||||||
|
}
|
||||||
if ($param['name'] === 'entities') {
|
if ($param['name'] === 'entities') {
|
||||||
$hasentities = true;
|
$hasentities = true;
|
||||||
$table .= '|parse\_mode| [string](../types/string.md) | Optional |
|
$table .= '|parse\_mode| [string](../types/string.md) | Optional |
|
||||||
@ -191,10 +195,10 @@ description: '.$description.'
|
|||||||
|
|
||||||
```
|
```
|
||||||
$MadelineProto = new \danog\MadelineProto\API();
|
$MadelineProto = new \danog\MadelineProto\API();
|
||||||
if (isset($token)) {
|
if (isset($token)) { // Login as a normal bot
|
||||||
$this->bot_login($token);
|
$this->bot_login($token);
|
||||||
}
|
}
|
||||||
if (isset($number)) {
|
if (isset($number)) { // Login as a user
|
||||||
$sentCode = $MadelineProto->phone_login($number);
|
$sentCode = $MadelineProto->phone_login($number);
|
||||||
echo \'Enter the code you received: \';
|
echo \'Enter the code you received: \';
|
||||||
$code = \'\';
|
$code = \'\';
|
||||||
@ -214,6 +218,14 @@ Or, if you\'re into Lua:
|
|||||||
```
|
```
|
||||||
|
|
||||||
');
|
');
|
||||||
|
if ($hasreplymarkup) {
|
||||||
|
$example .= '
|
||||||
|
## Usage of reply_markup:
|
||||||
|
|
||||||
|
You can provide bot API reply_markup objects here.
|
||||||
|
|
||||||
|
';
|
||||||
|
}
|
||||||
if ($hasentities) {
|
if ($hasentities) {
|
||||||
$example .= '
|
$example .= '
|
||||||
## Usage of parse_mode:
|
## Usage of parse_mode:
|
||||||
@ -361,6 +373,7 @@ description: List of methods
|
|||||||
|
|
||||||
$params = '';
|
$params = '';
|
||||||
$lua_params = '';
|
$lua_params = '';
|
||||||
|
$hasreplymarkup = false;
|
||||||
foreach ($this->constructors->params[$key] as $param) {
|
foreach ($this->constructors->params[$key] as $param) {
|
||||||
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
|
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
|
||||||
continue;
|
continue;
|
||||||
@ -390,7 +403,7 @@ description: List of methods
|
|||||||
$table .= $this->td_descriptions['constructors'][$rconstructor]['params'][$param['name']].'|';
|
$table .= $this->td_descriptions['constructors'][$rconstructor]['params'][$param['name']].'|';
|
||||||
}
|
}
|
||||||
$table .= PHP_EOL;
|
$table .= PHP_EOL;
|
||||||
|
if ($param['name'] === 'reply_markup) $hasreplymarkup = true;
|
||||||
$params .= "'".$param['name']."' => ";
|
$params .= "'".$param['name']."' => ";
|
||||||
$params .= (isset($param['subtype']) ? '['.$ptype.']' : $ptype).', ';
|
$params .= (isset($param['subtype']) ? '['.$ptype.']' : $ptype).', ';
|
||||||
$lua_params .= $param['name'].'=';
|
$lua_params .= $param['name'].'=';
|
||||||
@ -437,6 +450,14 @@ Or, if you\'re into Lua:
|
|||||||
|
|
||||||
|
|
||||||
';
|
';
|
||||||
|
if ($hasreplymarkup) {
|
||||||
|
$example .= '
|
||||||
|
## Usage of reply_markup:
|
||||||
|
|
||||||
|
You can provide bot API reply_markup objects here.
|
||||||
|
|
||||||
|
';
|
||||||
|
|
||||||
file_put_contents('constructors/'.$constructor.$layer.'.md', $header.$table.$type.$example);
|
file_put_contents('constructors/'.$constructor.$layer.'.md', $header.$table.$type.$example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user