getMyCommands method
Use this method to get the current list of the bot's commands for the given scope and user language
Returns Array of BotCommand on success. If commands aren't set, an empty list is returned.
Implementation
Future<List<BotCommand>> getMyCommands(
{BotCommandScope? scope, String? languageCode}) async {
var requestUrl = _apiUri('getMyCommands');
var body = <String, dynamic>{
'scope': scope == null ? null : jsonEncode(scope),
'language_code': languageCode,
};
return (await HttpClient.httpPost(requestUrl, body: body))
.map<BotCommand>((botCommand) => BotCommand.fromJson(botCommand))
.toList();
}