@@ -58,6 +58,13 @@ namespace Discord | |||||
/// A string containing the hash of this role's icon. | /// A string containing the hash of this role's icon. | ||||
/// </returns> | /// </returns> | ||||
string Icon { get; } | string Icon { get; } | ||||
/// <summary> | |||||
/// Gets the unicode emoji of this role. | |||||
/// </summary> | |||||
/// <remarks> | |||||
/// This field is mutually exclusive with <see cref="Icon"/>, either icon is set or emoji is set. | |||||
/// </remarks> | |||||
Emoji Emoji { get; } | |||||
/// <summary> | /// <summary> | ||||
/// Gets the permissions granted to members of this role. | /// Gets the permissions granted to members of this role. | ||||
/// </summary> | /// </summary> | ||||
@@ -9,7 +9,9 @@ namespace Discord.API | |||||
[JsonProperty("name")] | [JsonProperty("name")] | ||||
public string Name { get; set; } | public string Name { get; set; } | ||||
[JsonProperty("icon")] | [JsonProperty("icon")] | ||||
public string Icon { get; set; } | |||||
public Optional<string> Icon { get; set; } | |||||
[JsonProperty("unicode_emoji")] | |||||
public Optional<string> Emoji { get; set; } | |||||
[JsonProperty("color")] | [JsonProperty("color")] | ||||
public uint Color { get; set; } | public uint Color { get; set; } | ||||
[JsonProperty("hoist")] | [JsonProperty("hoist")] | ||||
@@ -25,6 +25,8 @@ namespace Discord.Rest | |||||
public string Name { get; private set; } | public string Name { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Icon { get; private set; } | public string Icon { get; private set; } | ||||
/// <inheritdoc>/> | |||||
public Emoji Emoji { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public GuildPermissions Permissions { get; private set; } | public GuildPermissions Permissions { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -55,7 +57,6 @@ namespace Discord.Rest | |||||
internal void Update(Model model) | internal void Update(Model model) | ||||
{ | { | ||||
Name = model.Name; | Name = model.Name; | ||||
Icon = model.Icon; | |||||
IsHoisted = model.Hoist; | IsHoisted = model.Hoist; | ||||
IsManaged = model.Managed; | IsManaged = model.Managed; | ||||
IsMentionable = model.Mentionable; | IsMentionable = model.Mentionable; | ||||
@@ -64,6 +65,16 @@ namespace Discord.Rest | |||||
Permissions = new GuildPermissions(model.Permissions); | Permissions = new GuildPermissions(model.Permissions); | ||||
if (model.Tags.IsSpecified) | if (model.Tags.IsSpecified) | ||||
Tags = model.Tags.Value.ToEntity(); | Tags = model.Tags.Value.ToEntity(); | ||||
if (model.Icon.IsSpecified) | |||||
{ | |||||
Icon = model.Icon.Value; | |||||
} | |||||
if (model.Emoji.IsSpecified) | |||||
{ | |||||
Emoji = new Emoji(model.Emoji.Value); | |||||
} | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -33,6 +33,8 @@ namespace Discord.WebSocket | |||||
public bool IsMentionable { get; private set; } | public bool IsMentionable { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Name { get; private set; } | public string Name { get; private set; } | ||||
/// <inheritdoc/> | |||||
public Emoji Emoji { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Icon { get; private set; } | public string Icon { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -74,7 +76,6 @@ namespace Discord.WebSocket | |||||
internal void Update(ClientState state, Model model) | internal void Update(ClientState state, Model model) | ||||
{ | { | ||||
Name = model.Name; | Name = model.Name; | ||||
Icon = model.Icon; | |||||
IsHoisted = model.Hoist; | IsHoisted = model.Hoist; | ||||
IsManaged = model.Managed; | IsManaged = model.Managed; | ||||
IsMentionable = model.Mentionable; | IsMentionable = model.Mentionable; | ||||
@@ -83,6 +84,16 @@ namespace Discord.WebSocket | |||||
Permissions = new GuildPermissions(model.Permissions); | Permissions = new GuildPermissions(model.Permissions); | ||||
if (model.Tags.IsSpecified) | if (model.Tags.IsSpecified) | ||||
Tags = model.Tags.Value.ToEntity(); | Tags = model.Tags.Value.ToEntity(); | ||||
if (model.Icon.IsSpecified) | |||||
{ | |||||
Icon = model.Icon.Value; | |||||
} | |||||
if (model.Emoji.IsSpecified) | |||||
{ | |||||
Emoji = new Emoji(model.Emoji.Value); | |||||
} | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||