TwitchChat/TwitchChatEmote.cs
namespace TwitchAPI;
public class TwitchChatEmote
{
/// <summary>
/// The ID of the emote.
/// </summary>
public string Id { get; private set; }
/// <summary>
/// The name/textcode of the emote.
/// </summary>
public string Emote { get; private set; }
/// <summary>
/// The starting character of the emote in the message.
/// </summary>
public int StartingCharacter { get; private set; }
/// <summary>
/// The ending character of the emote in the message.
/// </summary>
public int EndingCharacter { get; private set; }
internal TwitchChatEmote( string id, string emote, int startingCharacter, int endingCharacter )
{
Id = id;
Emote = emote;
StartingCharacter = startingCharacter;
EndingCharacter = endingCharacter;
}
/// <summary>
/// Returns the URL of the emote's image.
/// </summary>
/// <returns></returns>
public string GetImageUrl()
{
return $"https://static-cdn.jtvnw.net/emoticons/v2/{Id}/static/light/3.0";
}
public override string ToString()
{
return $"{Emote}";
}
}