setMyCommands method

Future<bool> setMyCommands(
  1. List<BotCommand> commands, {
  2. BotCommandScope? scope,
  3. String? language_code,
})
inherited

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.

https://core.telegram.org/bots/api#setmycommands

Implementation

Future<bool> setMyCommands(List<BotCommand> commands,
    {BotCommandScope? scope, String? language_code}) async {
  var requestUrl = _apiUri('setMyCommands');
  var body = <String, dynamic>{
    'commands': jsonEncode(commands),
    'scope': scope == null ? null : jsonEncode(scope),
    'language_code': language_code,
  };
  return await HttpClient.httpPost(requestUrl, body: body);
}