.Distinct() roles(ids) in IGuildUser.ModifyAsync (#2914)

This commit is contained in:
Mihail Gribkov
2024-04-23 00:13:15 +03:00
committed by GitHub
parent a2f624e6de
commit 27a0785653

View File

@@ -50,9 +50,9 @@ namespace Discord.Rest
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.