2.8.0: toObject, fromObject, use your ApiClient
This release, in addition to upgrading our Twurple to 7.x, brings three new features:
Emote.toObject()
(#31 - @Tzahi12345): You can export the data of an emote for caching or offline use.const emote = emoteFetcher.emotes.get('Kappa').toObject(); /* { id: '25', type: 'twitch', code: 'Kappa', animated: false, channel_id: null, set: undefined } */
EmoteFetcher.fromObject()
(#31 - @Tzahi12345): You can import an array of emotes directly into the fetcher.emoteFetcher.fromObject([emote]);
- The
EmoteFetcher
now accepts an object as a third parameter for options. (#33)
The only option for now isapiClient
and it allows you to use your own@twurple/api
'sApiClient
object, in case you already have one or want to manage authentification without app tokens.
Note that the first two parameters ofEmoteFetcher
will be unused in this case and can be left asnull
.const { ApiClient } = require('@twurple/api'); const { StaticAuthProvider } = require('@twurple/auth'); const authProvider = new StaticAuthProvider('<your client id>', '<your token>'); const apiClient = new ApiClient({ authProvider }); const fetcher = new EmoteFetcher(null, null, { apiClient });