single role fix for cleverbot

This commit is contained in:
Daniel Odendahl Jr
2017-05-14 04:12:06 +00:00
parent 57ec292dee
commit ce4a52779f
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -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 {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "19.3.2",
"version": "19.3.3",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {