nit: remove redundant CreateGuildRoleParams
CreateGuildRoleParams is identical to ModifyGuildRoleParams, so just use the latter when creating new roles.
This commit is contained in:
@@ -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);
|
||||
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));
|
||||
options = RequestOptions.CreateOrClone(options);
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace Discord.Rest
|
||||
{
|
||||
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>(),
|
||||
Hoist = isHoisted,
|
||||
|
||||
Reference in New Issue
Block a user