Added support for animated emoji (#913)
* Added support for animated emoji This was such a useful feature Discord, I'm glad you added this instead of fixing bugs. * Fix bugs in emote parser * Added unit tests for emotes
This commit is contained in:
@@ -9,6 +9,8 @@ namespace Discord.API
|
||||
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")]
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Discord.Rest
|
||||
{
|
||||
IEmote emote;
|
||||
if (model.Emoji.Id.HasValue)
|
||||
emote = new Emote(model.Emoji.Id.Value, model.Emoji.Name);
|
||||
emote = new Emote(model.Emoji.Id.Value, model.Emoji.Name, model.Emoji.Animated.GetValueOrDefault());
|
||||
else
|
||||
emote = new Emoji(model.Emoji.Name);
|
||||
return new RestReaction(emote, model.Count, model.Me);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Discord.Rest
|
||||
{
|
||||
public static GuildEmote ToEntity(this API.Emoji model)
|
||||
{
|
||||
return new GuildEmote(model.Id.Value, model.Name, model.Managed, model.RequireColons, ImmutableArray.Create(model.Roles));
|
||||
return new GuildEmote(model.Id.Value, model.Name, model.Animated.GetValueOrDefault(), model.Managed, model.RequireColons, ImmutableArray.Create(model.Roles));
|
||||
}
|
||||
|
||||
public static Embed ToEntity(this API.Embed model)
|
||||
|
||||
Reference in New Issue
Block a user