version: 2.1.3
setMyCommands
Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.
Parameters
commands | Array of BotCommand | A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. | Yes |
scope | BotCommandScope | A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. | Optional |
language_code | string | A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands | Optional |
token | String | You can use this method on another bot with specify this parameter | Optional |
return_array | Boolean | Specify the result type , if pass true results will be array otherwise will be object | Optional |
forgot | Boolean | You can set to not receive request result, dont set it or pass null for turn it off | Optional |
answer | Boolean | You can set to answer to webhook, dont set it or pass null for turn it off | Optional |
Method errors
ErrorName | description |
---|---|
required parameters not found | required parameter for this method is not founded. you can see them in log |
answer mode not allowed | you can use answer mode only once for each webhook update and you already did |
answer mode not allowed bc multi | you can't use answer mode when multi is on |
Method examples
$this->setMyCommands(['commands' => Array of BotCommand, 'scope' => BotCommandScope, 'language_code' => string]);
$this->setMyCommands(['commands' => Array of BotCommand]);
Method alices
setmycommands
setcommands