This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Add 7TV emotes to nodecg-io-twitch-addons #313
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added 7TV Emotes to the providers in nodecg-io-twitch-addons
Sadly, since Javascript variables (and object properties) can't start with numbers, I made 7tv's property on EmoteCollection 'stv' so users can access the collection with
emotes.stv
instead of using a string key with access throughemotes["7tv"]
Since it's common to make 7TV optional (at least in the chat clients I've looked over), I also modified the second parameter of getEmoteCollection (previously a boolean for 'includeGlobal') to be more of an "options" parameter. It's now an object of type:
{ includeGlobal: boolean, include7tv: boolean }
and has default values of{ includeGlobal: true, include7tv: false }
so users can just callgetEmoteCollection(emotes)
without the options.If I missed anything in my PR then please let me know!
Heres my NodeCG console printing a test of the providers' emote lengths (the '7tv' key is just part of the test object):
Cheers!
devJimmyboy