Closed askador closed 4 years ago
Hi!
I would suggest you take a look at the examples directory: https://github.com/unreal4u/telegram-api/tree/master/examples
There is no example yet of setMyCommands
, but you can get yourself a bit familiarized with how this library works this way.
Once you've done that, you'll be able to see that the SetMyCommands
method accepts one argument: an array of BotCommand
types:
https://github.com/unreal4u/telegram-api/blob/master/src/Telegram/Types/BotCommand.php
So to create one BotCommand, you'll have to do something similar to the following:
$botCommand = new BotCommand();
$botCommand->command = 'help';
$botCommand->description = 'Help is what help is for';
$setMyCommands = new SetMyCommands();
$setMyCommands->commands[] = $botCommand;
For more information on SetMyCommands
: https://github.com/unreal4u/telegram-api/blob/master/src/Telegram/Methods/SetMyCommands.php
After that, just follow the same flow as the SendMessage
example and you're good to go!
Greetings.
Thank you!
Hello! i need to set bot commands I saw type SetMyCommands but how can i use it?