add IsAvailable to GuildEmote
This commit is contained in:
@@ -39,15 +39,22 @@ namespace Discord
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
public ulong? CreatorId { get; }
|
public ulong? CreatorId { get; }
|
||||||
|
|
||||||
internal GuildEmote(ulong id, string name, bool animated, bool isManaged, bool requireColons, IReadOnlyList<ulong> roleIds, ulong? userId) : base(id, name, animated)
|
/// <summary>
|
||||||
|
/// Gets whether this emoji is available. <see langword="null" /> if unknown.
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsAvailable { get; }
|
||||||
|
|
||||||
|
internal GuildEmote(ulong id, string name, bool animated, bool isManaged, bool requireColons, IReadOnlyList<ulong> roleIds, ulong? userId, bool? isAvailable) : base(id, name, animated)
|
||||||
{
|
{
|
||||||
IsManaged = isManaged;
|
IsManaged = isManaged;
|
||||||
RequireColons = requireColons;
|
RequireColons = requireColons;
|
||||||
RoleIds = roleIds;
|
RoleIds = roleIds;
|
||||||
CreatorId = userId;
|
CreatorId = userId;
|
||||||
|
IsAvailable = isAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string DebuggerDisplay => $"{Name} ({Id})";
|
private string DebuggerDisplay => $"{Name} ({Id})";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the raw representation of the emote.
|
/// Gets the raw representation of the emote.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,22 +1,30 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Discord.API
|
namespace Discord.API;
|
||||||
{
|
|
||||||
internal class Emoji
|
internal class Emoji
|
||||||
{
|
{
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
public ulong? Id { get; set; }
|
public ulong? Id { get; set; }
|
||||||
|
|
||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[JsonProperty("animated")]
|
[JsonProperty("animated")]
|
||||||
public bool? Animated { get; set; }
|
public bool? Animated { get; set; }
|
||||||
|
|
||||||
[JsonProperty("roles")]
|
[JsonProperty("roles")]
|
||||||
public ulong[] Roles { get; set; }
|
public ulong[] Roles { get; set; }
|
||||||
|
|
||||||
[JsonProperty("require_colons")]
|
[JsonProperty("require_colons")]
|
||||||
public bool RequireColons { get; set; }
|
public bool RequireColons { get; set; }
|
||||||
|
|
||||||
[JsonProperty("managed")]
|
[JsonProperty("managed")]
|
||||||
public bool Managed { get; set; }
|
public bool Managed { get; set; }
|
||||||
|
|
||||||
[JsonProperty("user")]
|
[JsonProperty("user")]
|
||||||
public Optional<User> User { get; set; }
|
public Optional<User> User { get; set; }
|
||||||
}
|
|
||||||
|
[JsonProperty("available")]
|
||||||
|
public Optional<bool> IsAvailable { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ namespace Discord.Rest
|
|||||||
model.Managed,
|
model.Managed,
|
||||||
model.RequireColons,
|
model.RequireColons,
|
||||||
ImmutableArray.Create(model.Roles),
|
ImmutableArray.Create(model.Roles),
|
||||||
model.User.IsSpecified ? model.User.Value.Id : (ulong?)null);
|
model.User.IsSpecified ? model.User.Value.Id : null,
|
||||||
|
model.IsAvailable.ToNullable());
|
||||||
|
|
||||||
public static Embed ToEntity(this API.Embed model)
|
public static Embed ToEntity(this API.Embed model)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user