Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const clientId = '';
- const accessToken = '';
- const clientSecret = '';
- const refreshToken = '';
- const channelId = '';
- const PubSubClient = require('twitch-pubsub-client').default;
- const request = require("request");
- const TwitchClient = require('twitch').default;
- const run = async () => {
- const twitchClient = TwitchClient.withCredentials(clientId, accessToken, undefined, {clientSecret, refreshToken, onRefresh: async (t) => {
- }});
- const pubSubClient = new PubSubClient();
- await pubSubClient.registerUserListener(twitchClient);
- pubSubClient.onRedemption(channelId, (message) => {
- console.log(message);
- });
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement