@mkody/twitch-emoticons 2.6.2 → 2.7.0
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/README.md +13 -8
- package/docs/BTTVEmote.html +1319 -1241
- package/docs/Channel.html +823 -823
- package/docs/Collection.html +797 -797
- package/docs/Emote.html +801 -801
- package/docs/EmoteFetcher.html +2946 -2694
- package/docs/EmoteParser.html +811 -811
- package/docs/FFZEmote.html +1473 -1317
- package/docs/SevenTVEmote.html +1395 -1317
- package/docs/TwitchEmote.html +1315 -1237
- package/docs/index.html +206 -201
- package/docs/struct_BTTVEmote.js.html +79 -73
- package/docs/struct_Channel.js.html +72 -72
- package/docs/struct_Emote.js.html +73 -72
- package/docs/struct_EmoteFetcher.js.html +121 -77
- package/docs/struct_EmoteParser.js.html +73 -72
- package/docs/struct_FFZEmote.js.html +87 -74
- package/docs/struct_SevenTVEmote.js.html +79 -73
- package/docs/struct_TwitchEmote.js.html +79 -73
- package/docs/util_Collection.js.html +72 -72
- package/package.json +4 -4
- package/src/struct/BTTVEmote.js +7 -1
- package/src/struct/Emote.js +1 -0
- package/src/struct/EmoteFetcher.js +49 -5
- package/src/struct/EmoteParser.js +1 -0
- package/src/struct/FFZEmote.js +15 -2
- package/src/struct/SevenTVEmote.js +7 -1
- package/src/struct/TwitchEmote.js +7 -1
- package/src/util/Constants.js +9 -3
- package/test/index.js +18 -10
- package/typings/index.d.ts +9 -4
package/README.md
CHANGED
|
@@ -63,8 +63,10 @@ const clientSecret = '<your client secret>';
|
|
|
63
63
|
|
|
64
64
|
const fetcher = new EmoteFetcher(clientId, clientSecret);
|
|
65
65
|
const parser = new EmoteParser(fetcher, {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
// Custom HTML format
|
|
67
|
+
template: '<img class="emote" alt="{name}" src="{link}">',
|
|
68
|
+
// Match without :colons:
|
|
69
|
+
match: /(\w+)+?/g
|
|
68
70
|
});
|
|
69
71
|
|
|
70
72
|
Promise.all([
|
|
@@ -80,16 +82,18 @@ Promise.all([
|
|
|
80
82
|
fetcher.fetchSevenTVEmotes(),
|
|
81
83
|
// 7TV channel
|
|
82
84
|
fetcher.fetchSevenTVEmotes(channelId),
|
|
85
|
+
// FFZ global
|
|
86
|
+
fetcher.fetchFFZEmotes(),
|
|
83
87
|
// FFZ channel
|
|
84
88
|
fetcher.fetchFFZEmotes(channelId)
|
|
85
89
|
]).then(() => {
|
|
86
|
-
const globalEmotes = parser.parse('EZ Clap way too easy LUL now for the last
|
|
90
|
+
const globalEmotes = parser.parse('EZ Clap way too easy LUL now for the last boss monkaS LaterSooner');
|
|
87
91
|
console.log(globalEmotes);
|
|
88
|
-
// <img class="emote" alt="EZ" src="https://cdn.7tv.app/emote/
|
|
92
|
+
// <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">
|
|
89
93
|
|
|
90
94
|
const channelEmotes = parser.parse('KEKW that was 3Head TeriPoint');
|
|
91
95
|
console.log(channelEmotes);
|
|
92
|
-
// <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">
|
|
96
|
+
// <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">
|
|
93
97
|
}).catch(err => {
|
|
94
98
|
console.error('Error loading emotes...');
|
|
95
99
|
console.error(err);
|
|
@@ -125,6 +129,7 @@ fetcher.fetchSevenTVEmotes(24377667, 'avif');
|
|
|
125
129
|
- [Changelog](https://github.com/mkody/twitch-emoticons/releases)
|
|
126
130
|
|
|
127
131
|
This library uses the following:
|
|
128
|
-
- [
|
|
129
|
-
- [
|
|
130
|
-
- [
|
|
132
|
+
- [Twurple](https://twurple.js.org/) and the [Twitch API](https://dev.twitch.tv/)
|
|
133
|
+
- [BetterTTV API](https://betterttv.com/developers/api)
|
|
134
|
+
- [FrankerFaceZ API](https://api.frankerfacez.com/docs/)
|
|
135
|
+
- [7TV API](https://7tv.io/)
|