diff --git a/index.js b/index.js index bdcdf43..98f0ef0 100644 --- a/index.js +++ b/index.js @@ -150,7 +150,7 @@ const client = new Discord.Client(); client.on('ready', () => { console.log('Connected to Discord as ' + client.user.tag); client.user.setAvatar('avatar.png') - client.user.setUsername('Educ-Bot') + client.user.setUsername(process.env.BOT_USERNAME) }); /* Discord message center */ client.on('message', msg => { @@ -203,21 +203,21 @@ client.on('message', msg => { } /* save and ignore own messages */ else if(msg.author.username === process.env.BOT_USERNAME){ - if (msg.content.startsWith(':')) /* Save if its educpop summary */ + if (!msg.content.startsWith('<')) /* Save if its educpop summary */ channel.last_msg = msg; } /* Educ pop stuff */ else if(msg.content.startsWith('-')) { const content = msg.content.slice(1) if (content.toLowerCase() in reactions) { - educpopDelPerson(channel, msg.author.username, content.toLowerCase()) + educpopDelPerson(channel, msg.member.nickname, content.toLowerCase()) msg.delete() reply(channel) } } else if (msg.content.toLowerCase() in reactions) { var reaction = msg.content.toLowerCase() - educpopAddPerson(channel, msg.author.username, msg.content.toLowerCase()) + educpopAddPerson(channel, msg.member.nickname, msg.content.toLowerCase()) msg.delete() reply(channel) }