this is the source code
// Require statements
const { StaticAuthProvider } = require('twitch-auth');
const { ChatClient } = require('twitch-chat-client');
const config = require('./config.json');
// twitch api request thingies
const clientId = config.clientId;
const accessToken = config.accessToken;
const auth = new StaticAuthProvider(clientId, accessToken);
const chatClient = new ChatClient(auth, { channels: ['jop1481'] });
// random code
chatClient.onMessage((channel, user, message) => {
if (message === '!ping') {
chatClient.say(channel, 'Pong!');
} else if (message === '!dice') {
const diceRoll = Math.floor(Math.random() * 6) + 1;
chatClient.say(channel, `@${user} rolled a ${diceRoll}`)
}
});
chatClient.connect();