.Distinct() roles(ids) in IGuildUser.ModifyAsync (#2914)
This commit is contained in:
@@ -50,9 +50,9 @@ namespace Discord.Rest
|
|||||||
apiArgs.ChannelId = args.ChannelId.Value;
|
apiArgs.ChannelId = args.ChannelId.Value;
|
||||||
|
|
||||||
if (args.Roles.IsSpecified)
|
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)
|
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.
|
* Ensure that the nick passed in the params of the request is not null.
|
||||||
|
|||||||
Reference in New Issue
Block a user