From e56228d5f238bcf513051631f594e66c5a72cb10 Mon Sep 17 00:00:00 2001 From: Kody Date: Wed, 25 Dec 2019 16:59:46 +0100 Subject: [PATCH 01/63] `null` in fetchTwitchEmotes crashes Also it tries to test against `channel` instead of `channel_name` --- src/struct/EmoteFetcher.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/struct/EmoteFetcher.js b/src/struct/EmoteFetcher.js index 0742e8e..da825a7 100644 --- a/src/struct/EmoteFetcher.js +++ b/src/struct/EmoteFetcher.js @@ -149,7 +149,11 @@ class EmoteFetcher { return this._getRawTwitchEmotes().then(rawEmotes => { for (const key of Object.keys(rawEmotes)) { const data = rawEmotes[key]; - if (names === undefined || names.includes(data.channel)) { + if (names === null) { + if (data.channel_name === null) { + this._cacheTwitchEmote(key, data); + } + } else if (names === undefined || names.includes(data.channel_name)) { this._cacheTwitchEmote(key, data); } } From 955e4803dc569a89c01081686bec091888920800 Mon Sep 17 00:00:00 2001 From: Kody Date: Wed, 25 Dec 2019 17:02:16 +0100 Subject: [PATCH 02/63] Fix ident --- src/struct/EmoteFetcher.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/struct/EmoteFetcher.js b/src/struct/EmoteFetcher.js index da825a7..a755bf7 100644 --- a/src/struct/EmoteFetcher.js +++ b/src/struct/EmoteFetcher.js @@ -150,9 +150,9 @@ class EmoteFetcher { for (const key of Object.keys(rawEmotes)) { const data = rawEmotes[key]; if (names === null) { - if (data.channel_name === null) { - this._cacheTwitchEmote(key, data); - } + if (data.channel_name === null) { + this._cacheTwitchEmote(key, data); + } } else if (names === undefined || names.includes(data.channel_name)) { this._cacheTwitchEmote(key, data); } From e194a5640f8ce1a9afc745e20f11544b5035007f Mon Sep 17 00:00:00 2001 From: MKody Date: Mon, 30 Dec 2019 23:35:31 +0100 Subject: [PATCH 03/63] Support TwitchEmotes's v4 API Also fixed the html template. --- README.md | 2 +- docs/BTTVEmote.html | 60 +- docs/Channel.html | 5 +- docs/Collection.html | 11 +- docs/Emote.html | 15 +- docs/EmoteFetcher.html | 112 +++- docs/EmoteParser.html | 12 +- docs/FFZEmote.html | 49 +- docs/TwitchEmote.html | 208 +----- docs/index.html | 17 +- docs/struct_BTTVEmote.js.html | 2 +- docs/struct_Channel.js.html | 2 +- docs/struct_Emote.js.html | 2 +- docs/struct_EmoteFetcher.js.html | 49 +- docs/struct_EmoteParser.js.html | 2 +- docs/struct_FFZEmote.js.html | 2 +- docs/struct_TwitchEmote.js.html | 19 +- docs/util_Collection.js.html | 2 +- src/struct/EmoteFetcher.js | 51 +- src/struct/TwitchEmote.js | 17 +- src/util/Constants.js | 5 +- yarn.lock | 1056 ++++++++++++++++++++++++++++++ 22 files changed, 1333 insertions(+), 367 deletions(-) create mode 100644 yarn.lock diff --git a/README.md b/README.md index fb83e35..7874c4c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ const parser = new EmoteParser(fetcher, { match: /:(.+?):/g }); -fetcher.fetchTwitchEmotes().then(() => { +fetcher.fetchTwitchEmotes(null).then(() => { const kappa = fetcher.emotes.get('Kappa').toLink(); console.log(kappa); // https://static-cdn.jtvnw.net/emoticons/v1/25/1.0 diff --git a/docs/BTTVEmote.html b/docs/BTTVEmote.html index a4258d8..98ef760 100644 --- a/docs/BTTVEmote.html +++ b/docs/BTTVEmote.html @@ -65,7 +65,7 @@

new BTTVEmot
Source:
@@ -276,8 +276,10 @@

channelInherited From: -