a twitch bot with a command to add, remove and edit the alias of a 7tv emote
const tmi = require('tmi.js'); const fs = require('fs'); const opts = { identity: { username: process.env.BOT_USERNAME, password: process.env.OAUTH_TOKEN }, channels: [ process.env.CHANNEL_NAME ] }; const client = new tmi.client(opts); client.connect(); client.on('message', onMessageHandler); function onMessageHandler(target, context, msg, self) { if (self) { return; } // Ignore messages from the bot const commandName = msg.trim(); const dir = `${__dirname}/data`; if (commandName.substr(0, 1) !== '!') { return; } if (commandName === '!alias') { fs.readFile(`${dir}/${context.username}.json`, (err, data) => { if (err) {