const tmi = require('tmi.js'); require('dotenv').config(); console.log(process.env.API_HOST); const client = new tmi.Client({ options: { debug: true }, connection: { secure: true, reconnect: true }, identity: { //username: 'sariboto', username: process.env.TTV_BOT_USERNAME, password: process.env.TTV_BOT_OAUTH }, //channels: [ 'sarimoko' ] channels: [ process.env.TTV_CHANNELS ] }); client.connect(); client.on('message', (channel, tags, message, self) => { if(self) return; const badges = tags.badges || {}; const isBroadcaster = badges.broadcaster; const isMod = badges.moderator; const isModUp = isBroadcaster || isMod; }); client.on('message', (channel, tags, message, self) => { if(self || !message.startsWith('!')) return; const args = message.slice(1).split(' '); const command = args.shift().toLowerCase(); const botUserState = client.userstate[channel]; const amMod = botUserState !== undefined && botUserState.mod === true; // B E T A // ================================== // The Boto if(command === 'boto' || command === 'sariboto' || command === 'sari-boto') { client.say(channel, `/me Bleep! Bloop! Successfully connected to Twitch!`); client.say(channel, `!kappagen imGlitch EarthDay imGlitch EarthDay imGlitch`); } // The Echo else if(command === 'echo') { client.say(channel, `/me Off in the distance @${tags.username} screams...`); client.say(channel, `" ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} " can be heard to all those around!`); } // T H E S H O W // ================================== // Being Raided if(command === 'raid' || command === 'hello' || command === 'welcome' || command === 'greeting' || command === 'greetings') { client.say(channel, `!kappagen sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM sarimoRAID sarimoFREEDOM`); client.say(channel, `/me We give up @${tags.username}!!! to raid ${args.join(' ')}`); } // Raiding Someone if(command === 'raid' || command === 'hello' || command === 'welcome' || command === 'greeting' || command === 'greetings') { client.say(channel, `!kappagen HeyGuys bleedPurple HeyGuys bleedPurple HeyGuys`); client.say(channel, `/me Hi Hello Howdy Hola こんにちは Oi 你好 여보세요 Здравствуйте Bonjour Hej`); } // K A P P A // ================================== // FX | Hi if(command === 'hi' || command === 'hello' || command === 'welcome' || command === 'greeting' || command === 'greetings') { client.say(channel, `!kappagen HeyGuys bleedPurple HeyGuys bleedPurple HeyGuys`); client.say(channel, `/me Hi Hello Howdy Hola こんにちは Oi 你好 여보세요 Здравствуйте Bonjour Hej`); } // FX | Salt if(command === 'salt' || command === 'yoho' || command === 'rage' || command === 'rip' || command === 'sassy' || command === 'salty' || command === 'bitter') { client.say(channel, `!kappagen PJSalt PanicVis PJSalt WutFace PJSalt PunOko PJSalt BabyRage PJSalt`); } // G E N E R A L // ================================== // Uptime if(commandName === 'uptime') { let timestamp = new Date(body.stream.created_at).getTime(); uptime = countdown(timestamp, Date.now(), 158); reply(uptime); } // The 2Pac Timezone else if(command === '2pac' || command === 'pst' || command === 'timezone') { client.say(channel, `/me Off in the distance @${tags.username} screams...`); client.say(channel, `" ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} ${args.join(' ')} " can be heard to all those around!`); } // E R R O R S // ================================== // NOT FOUND FUNCTION else { client.say(channel, `/me Bleep! Bloop! Command NOT found! Sorry, @${tags.username} but did you typo it?`); } });