@mkody/twitch-emoticons 2.3.2 → 2.5.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/.github/workflows/yarn-test.yml +4 -1
- package/README.md +9 -8
- package/docs/BTTVEmote.html +1191 -1191
- package/docs/Channel.html +700 -700
- package/docs/Collection.html +791 -791
- package/docs/Emote.html +768 -768
- package/docs/EmoteFetcher.html +2075 -1940
- package/docs/EmoteParser.html +792 -792
- package/docs/FFZEmote.html +1263 -1263
- package/docs/TwitchEmote.html +1189 -1189
- package/docs/index.html +132 -131
- package/docs/struct_BTTVEmote.js.html +69 -69
- package/docs/struct_Channel.js.html +69 -69
- package/docs/struct_Emote.js.html +69 -69
- package/docs/struct_EmoteFetcher.js.html +94 -86
- package/docs/struct_EmoteParser.js.html +69 -69
- package/docs/struct_FFZEmote.js.html +69 -69
- package/docs/struct_TwitchEmote.js.html +69 -69
- package/docs/util_Collection.js.html +69 -69
- package/package.json +16 -12
- package/src/struct/EmoteFetcher.js +26 -18
- package/src/util/Constants.js +1 -4
- package/test/index.js +106 -25
- package/typings/index.d.ts +2 -0
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<title>struct/FFZEmote.js - Documentation</title>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
-
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
-
<!--[if lt IE 9]>
|
|
12
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
-
<![endif]-->
|
|
14
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
-
<script src="scripts/nav.js" defer></script>
|
|
17
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
|
|
21
|
-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
-
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
-
<div class="navicon"></div>
|
|
24
|
-
</label>
|
|
25
|
-
|
|
26
|
-
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
-
|
|
28
|
-
<nav >
|
|
29
|
-
|
|
30
|
-
<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></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#_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#_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#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="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>
|
|
31
|
-
</nav>
|
|
32
|
-
|
|
33
|
-
<div id="main">
|
|
34
|
-
|
|
35
|
-
<h1 class="page-title">struct/FFZEmote.js</h1>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<section>
|
|
44
|
-
<article>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>struct/FFZEmote.js - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav >
|
|
29
|
+
|
|
30
|
+
<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></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#_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#_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#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="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>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
<h1 class="page-title">struct/FFZEmote.js</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<article>
|
|
45
45
|
<pre class="prettyprint source linenums"><code>const Emote = require('./Emote');
|
|
46
46
|
const Constants = require('../util/Constants');
|
|
47
47
|
|
|
@@ -103,28 +103,28 @@ class FFZEmote extends Emote {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
module.exports = FFZEmote;
|
|
106
|
-
</code></pre>
|
|
107
|
-
</article>
|
|
108
|
-
</section>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<br class="clear">
|
|
118
|
-
|
|
119
|
-
<footer>
|
|
120
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.
|
|
121
|
-
</footer>
|
|
122
|
-
|
|
123
|
-
<script>prettyPrint();</script>
|
|
124
|
-
<script src="scripts/polyfill.js"></script>
|
|
125
|
-
<script src="scripts/linenumber.js"></script>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
</body>
|
|
130
|
-
</html>
|
|
106
|
+
</code></pre>
|
|
107
|
+
</article>
|
|
108
|
+
</section>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<br class="clear">
|
|
118
|
+
|
|
119
|
+
<footer>
|
|
120
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
121
|
+
</footer>
|
|
122
|
+
|
|
123
|
+
<script>prettyPrint();</script>
|
|
124
|
+
<script src="scripts/polyfill.js"></script>
|
|
125
|
+
<script src="scripts/linenumber.js"></script>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</body>
|
|
130
|
+
</html>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<title>struct/TwitchEmote.js - Documentation</title>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
-
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
-
<!--[if lt IE 9]>
|
|
12
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
-
<![endif]-->
|
|
14
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
-
<script src="scripts/nav.js" defer></script>
|
|
17
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
|
|
21
|
-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
-
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
-
<div class="navicon"></div>
|
|
24
|
-
</label>
|
|
25
|
-
|
|
26
|
-
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
-
|
|
28
|
-
<nav >
|
|
29
|
-
|
|
30
|
-
<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></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#_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#_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#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="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>
|
|
31
|
-
</nav>
|
|
32
|
-
|
|
33
|
-
<div id="main">
|
|
34
|
-
|
|
35
|
-
<h1 class="page-title">struct/TwitchEmote.js</h1>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<section>
|
|
44
|
-
<article>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>struct/TwitchEmote.js - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav >
|
|
29
|
+
|
|
30
|
+
<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></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#_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#_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#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="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>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
<h1 class="page-title">struct/TwitchEmote.js</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<article>
|
|
45
45
|
<pre class="prettyprint source linenums"><code>const Emote = require('./Emote');
|
|
46
46
|
const Constants = require('../util/Constants');
|
|
47
47
|
|
|
@@ -94,28 +94,28 @@ class TwitchEmote extends Emote {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
module.exports = TwitchEmote;
|
|
97
|
-
</code></pre>
|
|
98
|
-
</article>
|
|
99
|
-
</section>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<br class="clear">
|
|
109
|
-
|
|
110
|
-
<footer>
|
|
111
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.
|
|
112
|
-
</footer>
|
|
113
|
-
|
|
114
|
-
<script>prettyPrint();</script>
|
|
115
|
-
<script src="scripts/polyfill.js"></script>
|
|
116
|
-
<script src="scripts/linenumber.js"></script>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
</body>
|
|
121
|
-
</html>
|
|
97
|
+
</code></pre>
|
|
98
|
+
</article>
|
|
99
|
+
</section>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<br class="clear">
|
|
109
|
+
|
|
110
|
+
<footer>
|
|
111
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
112
|
+
</footer>
|
|
113
|
+
|
|
114
|
+
<script>prettyPrint();</script>
|
|
115
|
+
<script src="scripts/polyfill.js"></script>
|
|
116
|
+
<script src="scripts/linenumber.js"></script>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</body>
|
|
121
|
+
</html>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<title>util/Collection.js - Documentation</title>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
-
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
-
<!--[if lt IE 9]>
|
|
12
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
-
<![endif]-->
|
|
14
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
-
<script src="scripts/nav.js" defer></script>
|
|
17
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
|
|
21
|
-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
-
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
-
<div class="navicon"></div>
|
|
24
|
-
</label>
|
|
25
|
-
|
|
26
|
-
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
-
|
|
28
|
-
<nav >
|
|
29
|
-
|
|
30
|
-
<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></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#_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#_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#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="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>
|
|
31
|
-
</nav>
|
|
32
|
-
|
|
33
|
-
<div id="main">
|
|
34
|
-
|
|
35
|
-
<h1 class="page-title">util/Collection.js</h1>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<section>
|
|
44
|
-
<article>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>util/Collection.js - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav >
|
|
29
|
+
|
|
30
|
+
<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></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#_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#_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#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="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>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
<h1 class="page-title">util/Collection.js</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<article>
|
|
45
45
|
<pre class="prettyprint source linenums"><code>/**
|
|
46
46
|
* An extended Map with utility methods.
|
|
47
47
|
* @class Collection
|
|
@@ -120,28 +120,28 @@ class Collection extends Map {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
module.exports = Collection;
|
|
123
|
-
</code></pre>
|
|
124
|
-
</article>
|
|
125
|
-
</section>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<br class="clear">
|
|
135
|
-
|
|
136
|
-
<footer>
|
|
137
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.
|
|
138
|
-
</footer>
|
|
139
|
-
|
|
140
|
-
<script>prettyPrint();</script>
|
|
141
|
-
<script src="scripts/polyfill.js"></script>
|
|
142
|
-
<script src="scripts/linenumber.js"></script>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
</body>
|
|
147
|
-
</html>
|
|
123
|
+
</code></pre>
|
|
124
|
+
</article>
|
|
125
|
+
</section>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<br class="clear">
|
|
135
|
+
|
|
136
|
+
<footer>
|
|
137
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
138
|
+
</footer>
|
|
139
|
+
|
|
140
|
+
<script>prettyPrint();</script>
|
|
141
|
+
<script src="scripts/polyfill.js"></script>
|
|
142
|
+
<script src="scripts/linenumber.js"></script>
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
</body>
|
|
147
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkody/twitch-emoticons",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Gets Twitch
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"description": "Gets Twitch, BTTV and FFZ emotes as well as parsing text to emotes!",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "typings/index.d.ts",
|
|
7
7
|
"keywords": [
|
|
8
|
+
"better",
|
|
9
|
+
"bttv",
|
|
10
|
+
"emoji",
|
|
8
11
|
"emote",
|
|
9
12
|
"emoticon",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"better",
|
|
13
|
-
"twitch",
|
|
13
|
+
"ffz",
|
|
14
|
+
"parse",
|
|
14
15
|
"tv",
|
|
15
|
-
"
|
|
16
|
+
"twitch"
|
|
16
17
|
],
|
|
17
18
|
"author": "MKody <gh@kdy.ch> (André Fernandes)",
|
|
18
19
|
"contrubutors": [
|
|
19
20
|
"1Computer",
|
|
21
|
+
"Killusions",
|
|
20
22
|
"MKody"
|
|
21
23
|
],
|
|
22
24
|
"license": "MIT",
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"
|
|
26
|
+
"@twurple/api": "^5.1.7",
|
|
27
|
+
"@twurple/auth": "^5.1.7",
|
|
28
|
+
"got": "^11.8.5"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
31
|
"docdash": "^1.2.0",
|
|
28
|
-
"eslint": "^
|
|
29
|
-
"jsdoc": "^3.6.
|
|
32
|
+
"eslint": "^8.20.0",
|
|
33
|
+
"jsdoc": "^3.6.11"
|
|
30
34
|
},
|
|
31
35
|
"scripts": {
|
|
32
36
|
"docs": "jsdoc --configure .jsdoc.json --verbose --package ''",
|
|
33
37
|
"test": "node test/index.js",
|
|
34
|
-
"lint": "eslint ./src"
|
|
38
|
+
"lint": "eslint ./src ./test"
|
|
35
39
|
},
|
|
36
40
|
"repository": {
|
|
37
41
|
"type": "git",
|
|
@@ -45,4 +49,4 @@
|
|
|
45
49
|
"doc": "docs",
|
|
46
50
|
"test": "test"
|
|
47
51
|
}
|
|
48
|
-
}
|
|
52
|
+
}
|
|
@@ -5,6 +5,8 @@ const Constants = require('../util/Constants');
|
|
|
5
5
|
const FFZEmote = require('./FFZEmote');
|
|
6
6
|
const got = require('got');
|
|
7
7
|
const TwitchEmote = require('./TwitchEmote');
|
|
8
|
+
const { ApiClient } = require('@twurple/api');
|
|
9
|
+
const { ClientCredentialsAuthProvider } = require('@twurple/auth');
|
|
8
10
|
|
|
9
11
|
const options = {
|
|
10
12
|
responseType: 'json'
|
|
@@ -13,8 +15,19 @@ const options = {
|
|
|
13
15
|
class EmoteFetcher {
|
|
14
16
|
/**
|
|
15
17
|
* Fetches and caches emotes.
|
|
18
|
+
* @param {string} clientId The client id for the twitch api.
|
|
19
|
+
* @param {string} clientSecret The client secret for the twitch api.
|
|
16
20
|
*/
|
|
17
|
-
constructor() {
|
|
21
|
+
constructor(clientId, clientSecret) {
|
|
22
|
+
if (clientId !== undefined && clientSecret !== undefined) {
|
|
23
|
+
const authProvider = new ClientCredentialsAuthProvider(clientId, clientSecret);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Twitch api client.
|
|
27
|
+
*/
|
|
28
|
+
this.apiClient = new ApiClient({ authProvider });
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
/**
|
|
19
32
|
* Cached emotes.
|
|
20
33
|
* Collectionped by emote code to Emote instance.
|
|
@@ -46,20 +59,15 @@ class EmoteFetcher {
|
|
|
46
59
|
* @returns {Promise<Object[]>}
|
|
47
60
|
*/
|
|
48
61
|
_getRawTwitchEmotes(id) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return got(Constants.Twitch.GlobalFallback, options).body;
|
|
59
|
-
} else {
|
|
60
|
-
throw err;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
62
|
+
if (!this.apiClient) {
|
|
63
|
+
throw new Error('Client id or client secret not provided.');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (id) {
|
|
67
|
+
return this.apiClient.chat.getChannelEmotes(id);
|
|
68
|
+
} else {
|
|
69
|
+
return this.apiClient.chat.getGlobalEmotes();
|
|
70
|
+
}
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
/**
|
|
@@ -176,11 +184,11 @@ class EmoteFetcher {
|
|
|
176
184
|
*/
|
|
177
185
|
fetchTwitchEmotes(id = null) {
|
|
178
186
|
return this._getRawTwitchEmotes(id).then(rawEmotes => {
|
|
179
|
-
for (const
|
|
180
|
-
this._cacheTwitchEmote(
|
|
187
|
+
for (const emote of rawEmotes) {
|
|
188
|
+
this._cacheTwitchEmote(id, { code: emote.name, id: emote.id });
|
|
181
189
|
}
|
|
182
190
|
|
|
183
|
-
return this.channels.get(
|
|
191
|
+
return this.channels.get(id).emotes.filter(e => e.type === 'twitch');
|
|
184
192
|
});
|
|
185
193
|
}
|
|
186
194
|
|
package/src/util/Constants.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
Twitch: {
|
|
3
|
-
|
|
4
|
-
GlobalFallback: 'https://s.kdy.ch/global.json',
|
|
5
|
-
Channel: id => `https://api.twitchemotes.com/api/v4/channels/${id}`,
|
|
6
|
-
CDN: (id, size) => `https://static-cdn.jtvnw.net/emoticons/v1/${id}/${size + 1}.0`
|
|
3
|
+
CDN: (id, size) => `https://static-cdn.jtvnw.net/emoticons/v2/${id}/default/dark/${size + 1}.0`
|
|
7
4
|
},
|
|
8
5
|
BTTV: {
|
|
9
6
|
Global: 'https://api.betterttv.net/3/cached/emotes/global',
|