// B O T O // ================================== // TTV IRC BOT: Sariboto // ================================== // !COMMANDS // ================================== // TODO: // ================================== // + Add Cooldowns // + Add Mod vs Streamer vs Viewer vs Sub control // + Turn BOTO into join userchannel_db & make botoff to rm_userchannel_db // + Timed // + B-Day Calc // + // + 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: process.env.TTV_BOT_USERNAME, password: process.env.TTV_BOT_OAUTH }, 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; const botUserState = client.userstate[channel]; const amMod = botUserState !== undefined && botUserState.mod === true; const isSub = badges.subscriber || badges.founder; // !MODS if(isModUp && message.toLowerCase().startsWith('!so')) { console.log('MOD COMMAND | so | shoutout'); client.say(channel, `bloop`); } // !SUBS if(isSub) { console.log(tags.username, 'is a subscriber'); } // General Commands if(message.toLowerCase().startsWith('!mod')) { console.log('LOG: Non-Mod command used!'); } });