From 094ace0d2fdc915abb927bd76bd8e9daba787227 Mon Sep 17 00:00:00 2001 From: Adrian Amaglio Date: Thu, 2 Apr 2020 19:44:09 +0200 Subject: [PATCH] :bug: name and msg save --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) }