Skip to content

Commit

Permalink
[Fix] InteractionService.AddModulesXAsync command duplication (#2867)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha-133 committed Feb 27, 2024
1 parent 955fae0 commit 2787db3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Discord.Net.Interactions/InteractionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public async Task<IReadOnlyCollection<RestGuildCommand>> AddModulesToGuildAsync(
{
EnsureClientReady();

var props = modules.SelectMany(x => x.ToApplicationCommandProps(true)).ToList();
var props = modules.SelectMany(x => x.ToApplicationCommandProps(true)).Distinct().ToList();

if (!deleteMissing)
{
Expand All @@ -543,7 +543,7 @@ public async Task<IReadOnlyCollection<RestGlobalCommand>> AddModulesGloballyAsyn
{
EnsureClientReady();

var props = modules.SelectMany(x => x.ToApplicationCommandProps(true)).ToList();
var props = modules.SelectMany(x => x.ToApplicationCommandProps(true)).Distinct().ToList();

if (!deleteMissing)
{
Expand Down

0 comments on commit 2787db3

Please sign in to comment.