Skip to content

Commit

Permalink
.Distinct() roles(ids) in IGuildUser.ModifyAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha-133 committed Apr 22, 2024
1 parent a2f624e commit 967e682
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Discord.Net.Rest/Entities/Users/UserHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public static async Task<GuildUserProperties> ModifyAsync(IGuildUser user, BaseD
apiArgs.ChannelId = args.ChannelId.Value;

if (args.Roles.IsSpecified)
apiArgs.RoleIds = args.Roles.Value.Select(x => x.Id).ToArray();
apiArgs.RoleIds = args.Roles.Value.Select(x => x.Id).Distinct().ToArray();
else if (args.RoleIds.IsSpecified)
apiArgs.RoleIds = args.RoleIds.Value.ToArray();
apiArgs.RoleIds = args.RoleIds.Value.Distinct().ToArray();

/*
* Ensure that the nick passed in the params of the request is not null.
Expand Down

0 comments on commit 967e682

Please sign in to comment.