Requiring
Now that everything is ready and installed you'll have to require the library like this :
const ModerationPubsub = require('twitch-moderation-pubsub');
let pubsub = new ModerationPubsub({
token: '...',
topics: ['...','...','...'],
mod_id: '...'
});
// ... Event listeners and code
Token
token
- {String} - is the OAuth token of your twitch account without the "oauth:" part. Like on the example below :
Topics
topics
- Array[{String}] - has to be an array of channel IDs. I strongly recommend that the first one is the ID of the account you're using.
Mod_id
mod_id
- {String} - is the twitch ID of the account you're using to get the token.