Browse Source

Added length to Emoji

pull/299/head
RogueException 8 years ago
parent
commit
abd315ed21
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      src/Discord.Net.Core/Entities/Messages/Emoji.cs
  2. +1
    -1
      src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs

+ 3
- 1
src/Discord.Net.Core/Entities/Messages/Emoji.cs View File

@@ -7,14 +7,16 @@ namespace Discord
public ulong Id { get; }
public string Name { get; }
public int Index { get; }
public int Length { get; }

public string Url => CDN.GetEmojiUrl(Id);

internal Emoji(ulong id, string name, int index)
internal Emoji(ulong id, string name, int index, int length)
{
Id = id;
Name = name;
Index = index;
Length = length;
}
}
}

+ 1
- 1
src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs View File

@@ -45,7 +45,7 @@ namespace Discord.Rest
{
ulong id;
if (ulong.TryParse(match.Groups[2].Value, NumberStyles.None, CultureInfo.InvariantCulture, out id))
builder.Add(new Emoji(id, match.Groups[1].Value, match.Index));
builder.Add(new Emoji(id, match.Groups[1].Value, match.Index, match.Length));
}
return builder.ToImmutable();
}


Loading…
Cancel
Save