Browse Source

fix RemoveModulesFromGuildAsync

pull/2537/head
Gradyn Wursten 2 years ago
parent
commit
3b7223925e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.Interactions/InteractionService.cs

+ 2
- 2
src/Discord.Net.Interactions/InteractionService.cs View File

@@ -697,9 +697,9 @@ namespace Discord.Interactions
EnsureClientReady();

var exclude = modules.SelectMany(x => x.ToApplicationCommandProps(true)).ToList();
var existing = (await RestClient.GetGuildApplicationCommands(guildId).ConfigureAwait(false)).Select(x => x.ToApplicationCommandProps());
var existing = await RestClient.GetGuildApplicationCommands(guildId).ConfigureAwait(false);

var props = existing.Except(exclude);
var props = existing.Where(x => !exclude.Any(y => y.Name.IsSpecified && x.Name == y.Name.Value)).Select(x => x.ToApplicationCommandProps());

return await RestClient.BulkOverwriteGuildCommands(props.ToArray(), guildId).ConfigureAwait(false);
}


Loading…
Cancel
Save