Exemple #1
0
 public PluginApi(
     PluginInformation pluginInformation,
     IReadOnlyCollection<CommandDescription> commandDescriptions)
 {
     _pluginInformation = pluginInformation;
     _commandDescriptions = commandDescriptions;
 }
Exemple #2
0
 private async Task<IReadOnlyCollection<HelpDetails>> GetCommandDescriptionAsync(
     PluginInformation pluginInformation,
     CancellationToken cancellationToken)
 {
     var commandDescriptions = await _httpApi.GetAsyncAs<IReadOnlyCollection<CommandDescription>>(
         new Uri(pluginInformation.Uri, "_plugin/commands"),
         cancellationToken)
         .ConfigureAwait(false);
     return commandDescriptions
         .Select(d => new HelpDetails(d.Regex, d.Help))
         .ToList();
 }