From ce4a52779fb5726bc8aa73d982a6f91c3f19959e Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 14 May 2017 04:12:06 +0000 Subject: [PATCH] single role fix for cleverbot --- index.js | 10 +++++++--- package.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0c4bc803..53a8abce 100644 --- a/index.js +++ b/index.js @@ -65,10 +65,14 @@ client.on('commandError', (command, err) => { }); client.on('message', async (msg) => { - if (msg.author.bot) return; - if (msg.channel.type !== 'dm') - if (!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) return; if (msg.isMentioned(client.user)) { + if (msg.author.bot) return; + if (msg.channel.type !== 'dm') { + if (!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) return; + const singleRole = msg.guild.settings.get('singleRole'); + if (singleRole) + if (!msg.member.roles.has(singleRole)) return; + } msg.channel.startTyping(); const message = msg.content.replace(mention, ''); try { diff --git a/package.json b/package.json index 55f8cc68..65f5bb8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "19.3.2", + "version": "19.3.3", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": {