setBotCommands method

Future<Result<Boolean>> setBotCommands({
  1. required BotCommandScopeBase scope,
  2. required String langCode,
  3. required List<BotCommandBase> commands,
})

Set Bot Commands.

ID: 0517165a.

Implementation

Future<Result<Boolean>> setBotCommands({
  required BotCommandScopeBase scope,
  required String langCode,
  required List<BotCommandBase> commands,
}) async {
  // Preparing the request.
  final request = BotsSetBotCommands(
    scope: scope,
    langCode: langCode,
    commands: commands,
  );

  // Invoke and wait for response.
  final response = await _c.invoke(request);

  // Return the result.
  return response._to<Boolean>();
}