CreateGuildRoleParams is identical to ModifyGuildRoleParams, so just use the latter when creating new roles.pull/1567/head
@@ -1,19 +0,0 @@ | |||||
using Newtonsoft.Json; | |||||
namespace Discord.API.Rest | |||||
{ | |||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] | |||||
public class CreateGuildRoleParams | |||||
{ | |||||
[JsonProperty("name")] | |||||
public Optional<string> Name { get; set; } | |||||
[JsonProperty("permissions")] | |||||
public Optional<ulong> Permissions { get; set; } | |||||
[JsonProperty("color")] | |||||
public Optional<uint> Color { get; set; } | |||||
[JsonProperty("hoist")] | |||||
public Optional<bool> Hoist { get; set; } | |||||
[JsonProperty("mentionable")] | |||||
public Optional<bool> Mentionable { get; set; } | |||||
} | |||||
} |
@@ -1174,7 +1174,7 @@ namespace Discord.API | |||||
var ids = new BucketIds(guildId: guildId); | var ids = new BucketIds(guildId: guildId); | ||||
return await SendAsync<IReadOnlyCollection<Role>>("GET", () => $"guilds/{guildId}/roles", ids, options: options).ConfigureAwait(false); | return await SendAsync<IReadOnlyCollection<Role>>("GET", () => $"guilds/{guildId}/roles", ids, options: options).ConfigureAwait(false); | ||||
} | } | ||||
public async Task<Role> CreateGuildRoleAsync(ulong guildId, Rest.CreateGuildRoleParams args, RequestOptions options = null) | |||||
public async Task<Role> CreateGuildRoleAsync(ulong guildId, Rest.ModifyGuildRoleParams args, RequestOptions options = null) | |||||
{ | { | ||||
Preconditions.NotEqual(guildId, 0, nameof(guildId)); | Preconditions.NotEqual(guildId, 0, nameof(guildId)); | ||||
options = RequestOptions.CreateOrClone(options); | options = RequestOptions.CreateOrClone(options); | ||||
@@ -264,7 +264,7 @@ namespace Discord.Rest | |||||
{ | { | ||||
if (name == null) throw new ArgumentNullException(paramName: nameof(name)); | if (name == null) throw new ArgumentNullException(paramName: nameof(name)); | ||||
var createGuildRoleParams = new API.Rest.CreateGuildRoleParams | |||||
var createGuildRoleParams = new API.Rest.ModifyGuildRoleParams | |||||
{ | { | ||||
Color = color?.RawValue ?? Optional.Create<uint>(), | Color = color?.RawValue ?? Optional.Create<uint>(), | ||||
Hoist = isHoisted, | Hoist = isHoisted, | ||||