Emote Counter Stock Element

You can use this Stock Element by extending the exported global: window.casthub.elements.emote_counter

This Stock Element will render an extendable list of Emote instances with counts, and can automatically sort based on the most popular Emotes.

Adding an Emote

Emotes must be registered before they can have their counts incremented.

This just requires the unique Emote ID, as well as an Image that represents the Emote.

this.init('some-unique-id', 'https://example.com/test.png');

Incrementing an Emote Count

Using the same Emote ID an Emote was registered with, you can increment the count via the following method:


It is also possible to pass a second, integer-based parameter to increment the count by more than 1. For example:

this.inc('some-unique-id', 5); // Adds 5 to the count instead of 1


By default, Emotes will be sorted based on the counts they have. You can disable this by setting this.shouldSort to false in your Modules' constructor:

constructor() {

    // Disable automatic sorting.
    this.shouldSort = false;