Clean up some bugs when parsing unicode emoji
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Discord.API
|
||||
public class Emoji
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
public ulong? Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Discord
|
||||
}
|
||||
internal static GuildEmoji Create(Model model)
|
||||
{
|
||||
return new GuildEmoji(model.Id, model.Name, model.Managed, model.RequireColons, ImmutableArray.Create(model.Roles));
|
||||
return new GuildEmoji(model.Id.Value, model.Name, model.Managed, model.RequireColons, ImmutableArray.Create(model.Roles));
|
||||
}
|
||||
|
||||
public override string ToString() => Name;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Discord
|
||||
|
||||
internal static Emoji FromApi(API.Emoji emoji)
|
||||
{
|
||||
return new Emoji(emoji.Id, emoji.Name);
|
||||
return new Emoji(emoji.Id.GetValueOrDefault(), emoji.Name);
|
||||
}
|
||||
|
||||
public static Emoji Parse(string text)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Discord
|
||||
Task RemoveReactionAsync(Emoji emoji, IUser user, RequestOptions options = null);
|
||||
/// <summary> Removes a reaction from this message. </summary>
|
||||
Task RemoveReactionAsync(string emoji, IUser user, RequestOptions options = null);
|
||||
Task<IReadOnlyCollection<IUser>> GetReactionUsersAsync(string emoji, Action<GetReactionUsersParams> func, RequestOptions options = null);
|
||||
Task<IReadOnlyCollection<IUser>> GetReactionUsersAsync(string emoji, int limit = 100, ulong? afterUserId = null, RequestOptions options = null);
|
||||
|
||||
/// <summary> Transforms this message's text into a human readable form by resolving its tags. </summary>
|
||||
string Resolve(
|
||||
|
||||
Reference in New Issue
Block a user