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