var tmi = require('tmi.js'); var options = { options: { debug: true }, connection: { cluster: "aws", reconnect: true }, identity: { username: "MinuetteBOT", password: "" }, channels: ["hanjarolol"] }; var client = new tmi.client(options); client.connect(); client.on('connected', function(address, port){ console.log("Address: " , address + "Port: " + port); client.action("thederpysupport", "has connected."); }); client.on('chat', function(channel, user, message, self){ if(message === "!test"){ client.whisper(user['display-name'], "This is a test message."); } if(message === "!minuette"){ client.say("thederpysupport", "I am a Twitch Chat Bot."); } if(message === "!discord"){ if(user["user-type"] === "mod" || user["user-type"] === "caster" || user.username === channel.replace("#", "")){ client.say("thederpysupport", "You can join the Derpy Gaming Network discord by clicking this link: https://discord.gg/0nCaX7zRQ4pOgcXI")}; } if(message === "!stop"){ if (user['display-name'] === "TheDerpySupport"){ client.action(channels, "has disconnected."); client.disconnect(); } else { client.say("thederpysupport", "Sorry " + user['display-name'] + " only Derpy can shut me down.");} } });