Class for maintaining emotes that may be substituted into messages.
More...
|
static readonly ReadOnlyCollection< string > | TwitchEmoteUrls |
| Collection of Composite Format Strings which will substitute an emote ID to get a URL for an image from the Twitch CDN More...
|
|
static readonly ReadOnlyCollection< string > | FrankerFaceZEmoteUrls |
| Collection of Composite Format Strings which will substitute an emote ID to get a URL for an image from the FFZ CDN More...
|
|
static readonly ReadOnlyCollection< string > | BetterTwitchTvEmoteUrls |
| Collection of Composite Format Strings which will substitute an emote ID to get a URL for an image from the BTTV CDN More...
|
|
Class for maintaining emotes that may be substituted into messages.
Also contains helpers to aid in performing actual replacements. Expected to be called from the context of ChatMessage and WhisperMessage.
◆ EmoteSize
Enum denoting the emote sizes
◆ EmoteSource
Enum supplying the supported sites which provide Emote images.
◆ MessageEmote()
TwitchLib.Client.Models.MessageEmote.MessageEmote |
( |
string |
id, |
|
|
string |
text, |
|
|
EmoteSource |
source = EmoteSource.Twitch , |
|
|
EmoteSize |
size = EmoteSize.Small , |
|
|
ReplaceEmoteDelegate |
replacementDelegate = null |
|
) |
| |
Constructor for a new MessageEmote instance.
- Parameters
-
id | The unique identifier which the emote provider uses to generate CDN URLs. |
text | The string which users type to create this emote in chat. |
source | An EmoteSource where an image can be found for this emote. Default: EmoteSource.Twitch |
size | An EmoteSize to pull for this image. Default: EmoteSize.Small |
replacementDelegate | A string (optionally Composite Format with "{0}" representing id ) which will be used instead of any of the emote URLs. Default: null |
◆ ReplaceEmoteDelegate()
delegate string TwitchLib.Client.Models.MessageEmote.ReplaceEmoteDelegate |
( |
MessageEmote |
caller | ) |
|
Delegate allowing Emotes to handle their replacement text on a case-by-case basis.
- Returns
- The string for the calling emote to be replaced with.
◆ SourceMatchingReplacementText()
static string TwitchLib.Client.Models.MessageEmote.SourceMatchingReplacementText |
( |
MessageEmote |
caller | ) |
|
|
static |
◆ BetterTwitchTvEmoteUrls
readonly ReadOnlyCollection<string> TwitchLib.Client.Models.MessageEmote.BetterTwitchTvEmoteUrls |
|
static |
Initial value:= new ReadOnlyCollection<string>(
new[]
{
"//cdn.betterttv.net/emote/{0}/1x",
"//cdn.betterttv.net/emote/{0}/2x",
"//cdn.betterttv.net/emote/{0}/3x"
}
)
Collection of Composite Format Strings which will substitute an emote ID to get a URL for an image from the BTTV CDN
These are sorted such that the EmoteSize enum can be used as an index, eg BetterTwitchTvEmoteUrls[EmoteSize.Small]
◆ FrankerFaceZEmoteUrls
readonly ReadOnlyCollection<string> TwitchLib.Client.Models.MessageEmote.FrankerFaceZEmoteUrls |
|
static |
Initial value:= new ReadOnlyCollection<string>(
new[]
{
"//cdn.frankerfacez.com/emoticon/{0}/1",
"//cdn.frankerfacez.com/emoticon/{0}/2",
"//cdn.frankerfacez.com/emoticon/{0}/4"
}
)
Collection of Composite Format Strings which will substitute an emote ID to get a URL for an image from the FFZ CDN
These are sorted such that the EmoteSize enum can be used as an index, eg FrankerFaceZEmoteUrls[EmoteSize.Small] WARNING: FrankerFaceZ does not require users to submit all sizes, so using something other than Small images may result in broken links!
◆ TwitchEmoteUrls
readonly ReadOnlyCollection<string> TwitchLib.Client.Models.MessageEmote.TwitchEmoteUrls |
|
static |
Initial value:= new ReadOnlyCollection<string>(
new[]
{
"https://static-cdn.jtvnw.net/emoticons/v1/{0}/1.0",
"https://static-cdn.jtvnw.net/emoticons/v1/{0}/2.0",
"https://static-cdn.jtvnw.net/emoticons/v1/{0}/3.0"
}
)
Collection of Composite Format Strings which will substitute an emote ID to get a URL for an image from the Twitch CDN
These are sorted such that the EmoteSize enum can be used as an index, eg TwitchEmoteUrls[EmoteSize.Small]
◆ EscapedText
string TwitchLib.Client.Models.MessageEmote.EscapedText |
|
get |
The emote text regex-escaped so that it can be embedded into a regex pattern.
◆ Id
string TwitchLib.Client.Models.MessageEmote.Id |
|
get |
Emote ID as used by the emote source. Will be provided as {0} to be substituted into the indicated URL if needed.
◆ ReplacementDelegate
◆ ReplacementString
string TwitchLib.Client.Models.MessageEmote.ReplacementString |
|
get |
The string to substitute emote text for.
◆ Size
EmoteSize TwitchLib.Client.Models.MessageEmote.Size |
|
get |
◆ Source
EmoteSource TwitchLib.Client.Models.MessageEmote.Source |
|
get |
◆ Text
string TwitchLib.Client.Models.MessageEmote.Text |
|
get |
Emote text which appears in a message and is meant to be replaced by the emote image.
The documentation for this class was generated from the following file: