TwitchLib 3.5.3
Loading...
Searching...
No Matches
TwitchLib.Client.Models.MessageEmoteCollection Class Reference

Helper class which maintains a collection of all emotes active for a given channel. More...

Public Member Functions

 MessageEmoteCollection ()
 Default, empty constructor initializes the list and sets the preferred EmoteFilterDelegate to AllInclusiveEmoteFilter(MessageEmote) More...
 
 MessageEmoteCollection (EmoteFilterDelegate preferredFilter)
 Constructor which specifies a particular preferred T:TwitchLib.Models.Client.MessageEmoteCollection.EmoteFilterDelegate More...
 
void Add (MessageEmote emote)
 Adds an MessageEmote to the collection. Duplicate emotes (judged by MessageEmote.Text) are ignored. More...
 
void Merge (IEnumerable< MessageEmote > emotes)
 Adds every MessageEmote from an enumerable collection to the internal collection. Duplicate emotes (judged by MessageEmote.Text) are ignored. More...
 
void Remove (MessageEmote emote)
 Removes the specified MessageEmote from the collection. More...
 
void RemoveAll ()
 Removes all MessageEmotes from the collection. More...
 
string ReplaceEmotes (string originalMessage, EmoteFilterDelegate del=null)
 Replaces all instances of all registered emotes passing the provided EmoteFilterDelegate with their designated MessageEmote.ReplacementStrings More...
 
delegate bool EmoteFilterDelegate (MessageEmote emote)
 A delegate function which, when given a MessageEmote, determines whether it should be replaced. More...
 

Static Public Member Functions

static bool AllInclusiveEmoteFilter (MessageEmote emote)
 The default emote filter includes every MessageEmote registered on this list. More...
 
static bool TwitchOnlyEmoteFilter (MessageEmote emote)
 This emote filter includes only MessageEmotes provided by Twitch. More...
 

Detailed Description

Helper class which maintains a collection of all emotes active for a given channel.

Constructor & Destructor Documentation

◆ MessageEmoteCollection() [1/2]

TwitchLib.Client.Models.MessageEmoteCollection.MessageEmoteCollection ( )

Default, empty constructor initializes the list and sets the preferred EmoteFilterDelegate to AllInclusiveEmoteFilter(MessageEmote)

◆ MessageEmoteCollection() [2/2]

TwitchLib.Client.Models.MessageEmoteCollection.MessageEmoteCollection ( EmoteFilterDelegate  preferredFilter)

Constructor which specifies a particular preferred T:TwitchLib.Models.Client.MessageEmoteCollection.EmoteFilterDelegate

Parameters
preferredFilter

Member Function Documentation

◆ Add()

void TwitchLib.Client.Models.MessageEmoteCollection.Add ( MessageEmote  emote)

Adds an MessageEmote to the collection. Duplicate emotes (judged by MessageEmote.Text) are ignored.

Parameters
emoteThe MessageEmote to add to the collection.

◆ AllInclusiveEmoteFilter()

static bool TwitchLib.Client.Models.MessageEmoteCollection.AllInclusiveEmoteFilter ( MessageEmote  emote)
static

The default emote filter includes every MessageEmote registered on this list.

Parameters
emoteAn emote which is ignored in this filter.
Returns
true always

◆ EmoteFilterDelegate()

delegate bool TwitchLib.Client.Models.MessageEmoteCollection.EmoteFilterDelegate ( MessageEmote  emote)

A delegate function which, when given a MessageEmote, determines whether it should be replaced.

Parameters
emoteThe MessageEmote to be considered
Returns
true if the MessageEmote should be replaced.

◆ Merge()

void TwitchLib.Client.Models.MessageEmoteCollection.Merge ( IEnumerable< MessageEmote emotes)

Adds every MessageEmote from an enumerable collection to the internal collection. Duplicate emotes (judged by MessageEmote.Text) are ignored.

Parameters
emotesA collection of MessageEmotes.

◆ Remove()

void TwitchLib.Client.Models.MessageEmoteCollection.Remove ( MessageEmote  emote)

Removes the specified MessageEmote from the collection.

Parameters
emoteThe MessageEmote to remove.

◆ RemoveAll()

void TwitchLib.Client.Models.MessageEmoteCollection.RemoveAll ( )

Removes all MessageEmotes from the collection.

◆ ReplaceEmotes()

string TwitchLib.Client.Models.MessageEmoteCollection.ReplaceEmotes ( string  originalMessage,
EmoteFilterDelegate  del = null 
)

Replaces all instances of all registered emotes passing the provided EmoteFilterDelegate with their designated MessageEmote.ReplacementStrings

Parameters
originalMessageThe original message which needs to be processed for emotes.
delAn EmoteFilterDelegate which returns true if its received MessageEmote is to be replaced. Defaults to CurrentEmoteFilter.
Returns
A string where all of the original emote text has been replaced with its designated MessageEmote.ReplacementStrings

◆ TwitchOnlyEmoteFilter()

static bool TwitchLib.Client.Models.MessageEmoteCollection.TwitchOnlyEmoteFilter ( MessageEmote  emote)
static

This emote filter includes only MessageEmotes provided by Twitch.

Parameters
emoteA MessageEmote which will be replaced if its Source is MessageEmote.EmoteSource.Twitch
Returns
true always

The documentation for this class was generated from the following file: