Browse Source

feature: modify role icons

pull/1923/head
quin lynch 3 years ago
parent
commit
6cc4e65ae4
3 changed files with 9 additions and 1 deletions
  1. +5
    -0
      src/Discord.Net.Core/Entities/Roles/RoleProperties.cs
  2. +2
    -0
      src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs
  3. +2
    -1
      src/Discord.Net.Rest/Entities/Roles/RoleHelper.cs

+ 5
- 0
src/Discord.Net.Core/Entities/Roles/RoleProperties.cs View File

@@ -50,6 +50,11 @@ namespace Discord
/// This value may not be set if the role is an @everyone role. /// This value may not be set if the role is an @everyone role.
/// </remarks> /// </remarks>
public Optional<bool> Hoist { get; set; } public Optional<bool> Hoist { get; set; }

/// <summary>
/// Gets or sets the icon of the role.
/// </summary>
public Optional<Image> Icon { get; set; }
/// <summary> /// <summary>
/// Gets or sets whether or not this role can be mentioned. /// Gets or sets whether or not this role can be mentioned.
/// </summary> /// </summary>


+ 2
- 0
src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs View File

@@ -13,6 +13,8 @@ namespace Discord.API.Rest
public Optional<uint> Color { get; set; } public Optional<uint> Color { get; set; }
[JsonProperty("hoist")] [JsonProperty("hoist")]
public Optional<bool> Hoist { get; set; } public Optional<bool> Hoist { get; set; }
[JsonProperty("icon")]
public Optional<Image> Icon { get; set; }
[JsonProperty("mentionable")] [JsonProperty("mentionable")]
public Optional<bool> Mentionable { get; set; } public Optional<bool> Mentionable { get; set; }
} }


+ 2
- 1
src/Discord.Net.Rest/Entities/Roles/RoleHelper.cs View File

@@ -24,7 +24,8 @@ namespace Discord.Rest
Hoist = args.Hoist, Hoist = args.Hoist,
Mentionable = args.Mentionable, Mentionable = args.Mentionable,
Name = args.Name, Name = args.Name,
Permissions = args.Permissions.IsSpecified ? args.Permissions.Value.RawValue.ToString() : Optional.Create<string>()
Permissions = args.Permissions.IsSpecified ? args.Permissions.Value.RawValue.ToString() : Optional.Create<string>(),
Icon = args.Icon.IsSpecified ? args.Icon.Value.ToModel() : Optional<API.Image>.Unspecified
}; };
var model = await client.ApiClient.ModifyGuildRoleAsync(role.Guild.Id, role.Id, apiArgs, options).ConfigureAwait(false); var model = await client.ApiClient.ModifyGuildRoleAsync(role.Guild.Id, role.Id, apiArgs, options).ConfigureAwait(false);




Loading…
Cancel
Save