@mkody/twitch-emoticons 2.6.2 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +143 -143
- package/.github/codeql/codeql-config.yml +4 -4
- package/.github/workflows/codeql.yml +50 -50
- package/.github/workflows/eslint.yml +50 -50
- package/.github/workflows/release.yml +22 -0
- package/.github/workflows/yarn-test.yml +17 -17
- package/.jsdoc.json +39 -39
- package/.nvmrc +1 -0
- package/LICENSE +22 -22
- package/README.md +13 -8
- package/docs/BTTVEmote.html +83 -5
- package/docs/Channel.html +1 -1
- package/docs/Collection.html +1 -1
- package/docs/Emote.html +3 -3
- package/docs/EmoteFetcher.html +271 -19
- package/docs/EmoteParser.html +1 -1
- package/docs/FFZEmote.html +162 -6
- package/docs/SevenTV.html +1190 -1190
- package/docs/SevenTVEmote.html +84 -6
- package/docs/TwitchEmote.html +83 -5
- package/docs/index.html +15 -10
- package/docs/struct_BTTVEmote.js.html +61 -55
- package/docs/struct_Channel.js.html +56 -56
- package/docs/struct_Emote.js.html +67 -66
- package/docs/struct_EmoteFetcher.js.html +324 -284
- package/docs/struct_EmoteParser.js.html +82 -81
- package/docs/struct_FFZEmote.js.html +75 -62
- package/docs/struct_SevenTVEmote.js.html +70 -64
- package/docs/struct_TwitchEmote.js.html +59 -53
- package/docs/util_Collection.js.html +79 -79
- package/package.json +57 -57
- package/src/index.js +12 -12
- package/src/struct/BTTVEmote.js +60 -54
- package/src/struct/Channel.js +55 -55
- package/src/struct/Emote.js +66 -65
- package/src/struct/EmoteFetcher.js +323 -283
- package/src/struct/EmoteParser.js +81 -80
- package/src/struct/FFZEmote.js +74 -61
- package/src/struct/SevenTVEmote.js +69 -63
- package/src/struct/TwitchEmote.js +58 -52
- package/src/util/Collection.js +78 -78
- package/src/util/Constants.js +31 -25
- package/test/index.js +174 -166
- package/typings/index.d.ts +98 -93
package/docs/SevenTVEmote.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmoteSet">_getRawFFZEmoteSet</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -274,6 +274,84 @@
|
|
|
274
274
|
|
|
275
275
|
|
|
276
276
|
|
|
277
|
+
<h4 class="name" id="animated"><span class="type-signature"></span>animated<span class="type-signature"> :boolean</span></h4>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
<dl class="details">
|
|
284
|
+
|
|
285
|
+
<dt class="tag-description">Description:</dt>
|
|
286
|
+
<dd class="tag-description"><ul class="dummy"><li><p>If emote is animated.</p></li></ul></dd>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
<dt class="tag-source">Source:</dt>
|
|
291
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
292
|
+
<a href="struct_SevenTVEmote.js.html">struct/SevenTVEmote.js</a>, <a href="struct_SevenTVEmote.js.html#line49">line 49</a>
|
|
293
|
+
</li></ul></dd>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
</dl>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
<div class="description usertext">
|
|
332
|
+
<p>If emote is animated.</p>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<h5 class="h5-types">Type:</h5>
|
|
338
|
+
<ul>
|
|
339
|
+
<li>
|
|
340
|
+
|
|
341
|
+
<span class="param-type">boolean</span>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
</li>
|
|
346
|
+
</ul>
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
277
355
|
<h4 class="name" id="channel"><span class="type-signature"></span>channel<span class="type-signature"> :<a href="Channel.html">Channel</a></span></h4>
|
|
278
356
|
|
|
279
357
|
|
|
@@ -376,7 +454,7 @@ For other types of emotes, use the <code>owner</code> or <code>ownerName</code>
|
|
|
376
454
|
|
|
377
455
|
<dt class="tag-source">Source:</dt>
|
|
378
456
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
379
|
-
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#
|
|
457
|
+
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#line49">line 49</a>
|
|
380
458
|
</li></ul></dd>
|
|
381
459
|
|
|
382
460
|
|
|
@@ -625,7 +703,7 @@ For other types of emotes, use the <code>owner</code> or <code>ownerName</code>
|
|
|
625
703
|
|
|
626
704
|
<dt class="tag-source">Source:</dt>
|
|
627
705
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
628
|
-
<a href="struct_SevenTVEmote.js.html">struct/SevenTVEmote.js</a>, <a href="struct_SevenTVEmote.js.html#
|
|
706
|
+
<a href="struct_SevenTVEmote.js.html">struct/SevenTVEmote.js</a>, <a href="struct_SevenTVEmote.js.html#line55">line 55</a>
|
|
629
707
|
</li></ul></dd>
|
|
630
708
|
|
|
631
709
|
|
|
@@ -768,7 +846,7 @@ Not guaranteed to contain the emote, or be cached.</p>
|
|
|
768
846
|
|
|
769
847
|
|
|
770
848
|
|
|
771
|
-
<h4 class="name" id="ownerName"><span class="type-signature"
|
|
849
|
+
<h4 class="name" id="ownerName"><span class="type-signature type-signature-nullable">(nullable) </span>ownerName<span class="type-signature"> :string</span></h4>
|
|
772
850
|
|
|
773
851
|
|
|
774
852
|
|
|
@@ -1034,7 +1112,7 @@ Either <code>twitch</code>, <code>bttv</code>, <code>ffz</code>, or '7tv'.</p>
|
|
|
1034
1112
|
|
|
1035
1113
|
<dt class="tag-source">Source:</dt>
|
|
1036
1114
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
1037
|
-
<a href="struct_SevenTVEmote.js.html">struct/SevenTVEmote.js</a>, <a href="struct_SevenTVEmote.js.html#
|
|
1115
|
+
<a href="struct_SevenTVEmote.js.html">struct/SevenTVEmote.js</a>, <a href="struct_SevenTVEmote.js.html#line63">line 63</a>
|
|
1038
1116
|
</li></ul></dd>
|
|
1039
1117
|
|
|
1040
1118
|
|
|
@@ -1197,7 +1275,7 @@ Will give the emote's name.</p></li></ul></dd>
|
|
|
1197
1275
|
|
|
1198
1276
|
<dt class="tag-source">Source:</dt>
|
|
1199
1277
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
1200
|
-
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#
|
|
1278
|
+
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#line61">line 61</a>
|
|
1201
1279
|
</li></ul></dd>
|
|
1202
1280
|
|
|
1203
1281
|
|
package/docs/TwitchEmote.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmoteSet">_getRawFFZEmoteSet</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -274,6 +274,84 @@
|
|
|
274
274
|
|
|
275
275
|
|
|
276
276
|
|
|
277
|
+
<h4 class="name" id="animated"><span class="type-signature"></span>animated<span class="type-signature"> :boolean</span></h4>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
<dl class="details">
|
|
284
|
+
|
|
285
|
+
<dt class="tag-description">Description:</dt>
|
|
286
|
+
<dd class="tag-description"><ul class="dummy"><li><p>If emote is animated.</p></li></ul></dd>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
<dt class="tag-source">Source:</dt>
|
|
291
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
292
|
+
<a href="struct_TwitchEmote.js.html">struct/TwitchEmote.js</a>, <a href="struct_TwitchEmote.js.html#line39">line 39</a>
|
|
293
|
+
</li></ul></dd>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
</dl>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
<div class="description usertext">
|
|
332
|
+
<p>If emote is animated.</p>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<h5 class="h5-types">Type:</h5>
|
|
338
|
+
<ul>
|
|
339
|
+
<li>
|
|
340
|
+
|
|
341
|
+
<span class="param-type">boolean</span>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
</li>
|
|
346
|
+
</ul>
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
277
355
|
<h4 class="name" id="channel"><span class="type-signature"></span>channel<span class="type-signature"> :<a href="Channel.html">Channel</a></span></h4>
|
|
278
356
|
|
|
279
357
|
|
|
@@ -376,7 +454,7 @@ For other types of emotes, use the <code>owner</code> or <code>ownerName</code>
|
|
|
376
454
|
|
|
377
455
|
<dt class="tag-source">Source:</dt>
|
|
378
456
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
379
|
-
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#
|
|
457
|
+
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#line49">line 49</a>
|
|
380
458
|
</li></ul></dd>
|
|
381
459
|
|
|
382
460
|
|
|
@@ -625,7 +703,7 @@ For other types of emotes, use the <code>owner</code> or <code>ownerName</code>
|
|
|
625
703
|
|
|
626
704
|
<dt class="tag-source">Source:</dt>
|
|
627
705
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
628
|
-
<a href="struct_TwitchEmote.js.html">struct/TwitchEmote.js</a>, <a href="struct_TwitchEmote.js.html#
|
|
706
|
+
<a href="struct_TwitchEmote.js.html">struct/TwitchEmote.js</a>, <a href="struct_TwitchEmote.js.html#line45">line 45</a>
|
|
629
707
|
</li></ul></dd>
|
|
630
708
|
|
|
631
709
|
|
|
@@ -954,7 +1032,7 @@ Either <code>twitch</code>, <code>bttv</code>, <code>ffz</code>, or '7tv'.</p>
|
|
|
954
1032
|
|
|
955
1033
|
<dt class="tag-source">Source:</dt>
|
|
956
1034
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
957
|
-
<a href="struct_TwitchEmote.js.html">struct/TwitchEmote.js</a>, <a href="struct_TwitchEmote.js.html#
|
|
1035
|
+
<a href="struct_TwitchEmote.js.html">struct/TwitchEmote.js</a>, <a href="struct_TwitchEmote.js.html#line53">line 53</a>
|
|
958
1036
|
</li></ul></dd>
|
|
959
1037
|
|
|
960
1038
|
|
|
@@ -1117,7 +1195,7 @@ Will give the emote's name.</p></li></ul></dd>
|
|
|
1117
1195
|
|
|
1118
1196
|
<dt class="tag-source">Source:</dt>
|
|
1119
1197
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
1120
|
-
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#
|
|
1198
|
+
<a href="struct_Emote.js.html">struct/Emote.js</a>, <a href="struct_Emote.js.html#line61">line 61</a>
|
|
1121
1199
|
</li></ul></dd>
|
|
1122
1200
|
|
|
1123
1201
|
|
package/docs/index.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmoteSet">_getRawFFZEmoteSet</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<section class="package">
|
|
47
|
-
<h3>@mkody/twitch-emoticons 2.
|
|
47
|
+
<h3>@mkody/twitch-emoticons 2.7.1</h3>
|
|
48
48
|
</section>
|
|
49
49
|
|
|
50
50
|
|
|
@@ -113,8 +113,10 @@ const clientSecret = '<your client secret>';
|
|
|
113
113
|
|
|
114
114
|
const fetcher = new EmoteFetcher(clientId, clientSecret);
|
|
115
115
|
const parser = new EmoteParser(fetcher, {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
// Custom HTML format
|
|
117
|
+
template: '<img class="emote" alt="{name}" src="{link}">',
|
|
118
|
+
// Match without :colons:
|
|
119
|
+
match: /(\w+)+?/g
|
|
118
120
|
});
|
|
119
121
|
|
|
120
122
|
Promise.all([
|
|
@@ -130,16 +132,18 @@ Promise.all([
|
|
|
130
132
|
fetcher.fetchSevenTVEmotes(),
|
|
131
133
|
// 7TV channel
|
|
132
134
|
fetcher.fetchSevenTVEmotes(channelId),
|
|
135
|
+
// FFZ global
|
|
136
|
+
fetcher.fetchFFZEmotes(),
|
|
133
137
|
// FFZ channel
|
|
134
138
|
fetcher.fetchFFZEmotes(channelId)
|
|
135
139
|
]).then(() => {
|
|
136
|
-
const globalEmotes = parser.parse('EZ Clap way too easy LUL now for the last
|
|
140
|
+
const globalEmotes = parser.parse('EZ Clap way too easy LUL now for the last boss monkaS LaterSooner');
|
|
137
141
|
console.log(globalEmotes);
|
|
138
|
-
// <img class="emote" alt="EZ" src="https://cdn.7tv.app/emote/
|
|
142
|
+
// <img class="emote" alt="EZ" src="https://cdn.7tv.app/emote/63071b80942ffb69e13d700f/1x.webp"> <img class="emote" alt="Clap" src="https://cdn.7tv.app/emote/62fc0a0c4a75fd54bd3520a9/1x.webp"> way too easy <img class="emote" alt="LUL" src="https://static-cdn.jtvnw.net/emoticons/v2/425618/default/dark/1.0"> now for the last boss <img class="emote" alt="monkaS" src="https://cdn.betterttv.net/emote/56e9f494fff3cc5c35e5287e/1x.webp"> <img class="emote" alt="LaterSooner" src="https://cdn.frankerfacez.com/emote/149346/1">
|
|
139
143
|
|
|
140
144
|
const channelEmotes = parser.parse('KEKW that was 3Head TeriPoint');
|
|
141
145
|
console.log(channelEmotes);
|
|
142
|
-
// <img class="emote" alt="KEKW" src="https://cdn.betterttv.net/emote/5e9c6c187e090362f8b0b9e8/1x"> that was <img class="emote" alt="3Head" src="https://cdn.frankerfacez.com/emote/274406/1"> <img class="emote" alt="TeriPoint" src="https://cdn.7tv.app/emote/61dc299b600369a98b38ebef/1x.webp">
|
|
146
|
+
// <img class="emote" alt="KEKW" src="https://cdn.betterttv.net/emote/5e9c6c187e090362f8b0b9e8/1x.webp"> that was <img class="emote" alt="3Head" src="https://cdn.frankerfacez.com/emote/274406/1"> <img class="emote" alt="TeriPoint" src="https://cdn.7tv.app/emote/61dc299b600369a98b38ebef/1x.webp">
|
|
143
147
|
}).catch(err => {
|
|
144
148
|
console.error('Error loading emotes...');
|
|
145
149
|
console.error(err);
|
|
@@ -171,9 +175,10 @@ fetcher.fetchSevenTVEmotes(24377667, 'avif');
|
|
|
171
175
|
</ul>
|
|
172
176
|
<p>This library uses the following:</p>
|
|
173
177
|
<ul>
|
|
174
|
-
<li><a href="https://
|
|
175
|
-
<li><a href="https://
|
|
176
|
-
<li><a href="https://
|
|
178
|
+
<li><a href="https://twurple.js.org/">Twurple</a> and the <a href="https://dev.twitch.tv/">Twitch API</a></li>
|
|
179
|
+
<li><a href="https://betterttv.com/developers/api">BetterTTV API</a></li>
|
|
180
|
+
<li><a href="https://api.frankerfacez.com/docs/">FrankerFaceZ API</a></li>
|
|
181
|
+
<li><a href="https://7tv.io/">7TV API</a></li>
|
|
177
182
|
</ul></article>
|
|
178
183
|
</section>
|
|
179
184
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BTTVEmote.html">BTTVEmote</a><ul class='methods'><li data-type='method'><a href="BTTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="BTTVEmote.html#toString">toString</a></li></ul></li><li><a href="Channel.html">Channel</a><ul class='methods'><li data-type='method'><a href="Channel.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="Channel.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="Channel.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li></ul></li><li><a href="Collection.html">Collection</a><ul class='methods'><li data-type='method'><a href="Collection.html#filter">filter</a></li><li data-type='method'><a href="Collection.html#find">find</a></li><li data-type='method'><a href="Collection.html#map">map</a></li></ul></li><li><a href="Emote.html">Emote</a><ul class='methods'><li data-type='method'><a href="Emote.html#toString">toString</a></li></ul></li><li><a href="EmoteFetcher.html">EmoteFetcher</a><ul class='methods'><li data-type='method'><a href="EmoteFetcher.html#_cacheBTTVEmote">_cacheBTTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheFFZEmote">_cacheFFZEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheSevenTVEmote">_cacheSevenTVEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_cacheTwitchEmote">_cacheTwitchEmote</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawBTTVEmotes">_getRawBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmoteSet">_getRawFFZEmoteSet</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawFFZEmotes">_getRawFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawSevenTVEmotes">_getRawSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#_getRawTwitchEmotes">_getRawTwitchEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchBTTVEmotes">fetchBTTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchFFZEmotes">fetchFFZEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchSevenTVEmotes">fetchSevenTVEmotes</a></li><li data-type='method'><a href="EmoteFetcher.html#fetchTwitchEmotes">fetchTwitchEmotes</a></li></ul></li><li><a href="EmoteParser.html">EmoteParser</a><ul class='methods'><li data-type='method'><a href="EmoteParser.html#parse">parse</a></li></ul></li><li><a href="FFZEmote.html">FFZEmote</a><ul class='methods'><li data-type='method'><a href="FFZEmote.html#toLink">toLink</a></li><li data-type='method'><a href="FFZEmote.html#toString">toString</a></li></ul></li><li><a href="SevenTVEmote.html">SevenTVEmote</a><ul class='methods'><li data-type='method'><a href="SevenTVEmote.html#toLink">toLink</a></li><li data-type='method'><a href="SevenTVEmote.html#toString">toString</a></li></ul></li><li><a href="TwitchEmote.html">TwitchEmote</a><ul class='methods'><li data-type='method'><a href="TwitchEmote.html#toLink">toLink</a></li><li data-type='method'><a href="TwitchEmote.html#toString">toString</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -45,60 +45,66 @@
|
|
|
45
45
|
|
|
46
46
|
<section>
|
|
47
47
|
<article>
|
|
48
|
-
<pre class="prettyprint source linenums"><code>const Emote = require('./Emote');
|
|
49
|
-
const Constants = require('../util/Constants');
|
|
50
|
-
|
|
51
|
-
/** @extends Emote */
|
|
52
|
-
class BTTVEmote extends Emote {
|
|
53
|
-
/**
|
|
54
|
-
* A BTTV emote.
|
|
55
|
-
* @param {Channel} channel - Channel this emote belongs to.
|
|
56
|
-
* @param {string} id - ID of the emote.
|
|
57
|
-
* @param {data} data - The raw emote data.
|
|
58
|
-
*/
|
|
59
|
-
constructor(channel, id, data) {
|
|
60
|
-
super(channel, id, data);
|
|
61
|
-
this.type = 'bttv';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* The channel of this emote's creator.
|
|
66
|
-
* Not guaranteed to contain the emote, or be cached.
|
|
67
|
-
* @readonly
|
|
68
|
-
* @type {?Channel}
|
|
69
|
-
*/
|
|
70
|
-
get owner() {
|
|
71
|
-
return this.fetcher.channels.get(this.ownerName);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
_setup(data) {
|
|
75
|
-
super._setup(data);
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* The name of the emote creator's channel.
|
|
79
|
-
* Will be null for global or channel emotes.
|
|
80
|
-
* @type {?string}
|
|
81
|
-
*/
|
|
82
|
-
this.ownerName = 'user' in data ? data.user.name : null;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @type {
|
|
87
|
-
*/
|
|
88
|
-
this.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
48
|
+
<pre class="prettyprint source linenums"><code>const Emote = require('./Emote');
|
|
49
|
+
const Constants = require('../util/Constants');
|
|
50
|
+
|
|
51
|
+
/** @extends Emote */
|
|
52
|
+
class BTTVEmote extends Emote {
|
|
53
|
+
/**
|
|
54
|
+
* A BTTV emote.
|
|
55
|
+
* @param {Channel} channel - Channel this emote belongs to.
|
|
56
|
+
* @param {string} id - ID of the emote.
|
|
57
|
+
* @param {data} data - The raw emote data.
|
|
58
|
+
*/
|
|
59
|
+
constructor(channel, id, data) {
|
|
60
|
+
super(channel, id, data);
|
|
61
|
+
this.type = 'bttv';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The channel of this emote's creator.
|
|
66
|
+
* Not guaranteed to contain the emote, or be cached.
|
|
67
|
+
* @readonly
|
|
68
|
+
* @type {?Channel}
|
|
69
|
+
*/
|
|
70
|
+
get owner() {
|
|
71
|
+
return this.fetcher.channels.get(this.ownerName);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
_setup(data) {
|
|
75
|
+
super._setup(data);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The name of the emote creator's channel.
|
|
79
|
+
* Will be null for global or channel emotes.
|
|
80
|
+
* @type {?string}
|
|
81
|
+
*/
|
|
82
|
+
this.ownerName = 'user' in data ? data.user.name : null;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* If emote is animated.
|
|
86
|
+
* @type {boolean}
|
|
87
|
+
*/
|
|
88
|
+
this.animated = data.animated;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The image type of the emote.
|
|
92
|
+
* @type {string}
|
|
93
|
+
*/
|
|
94
|
+
this.imageType = 'webp';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Gets the image link of the emote.
|
|
99
|
+
* @param {number} size - The size of the image, 0, 1, or 2.
|
|
100
|
+
* @returns {string}
|
|
101
|
+
*/
|
|
102
|
+
toLink(size = 0) {
|
|
103
|
+
return Constants.BTTV.CDN(this.id, size); // eslint-disable-line new-cap
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
module.exports = BTTVEmote;
|
|
102
108
|
</code></pre>
|
|
103
109
|
</article>
|
|
104
110
|
</section>
|