From b75187150d2cd007c772ca869c92085d43954717 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 11 Jun 2020 22:29:36 -0400 Subject: [PATCH] Don't DM in auto-reply commands --- package.json | 2 +- structures/commands/AutoReply.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fbda72b2..9c9512a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "116.17.1", + "version": "116.17.2", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { diff --git a/structures/commands/AutoReply.js b/structures/commands/AutoReply.js index 405fdea0..a7d0e6f5 100644 --- a/structures/commands/AutoReply.js +++ b/structures/commands/AutoReply.js @@ -9,6 +9,7 @@ module.exports = class AutoReplyCommand extends Command { } run(msg, args, fromPattern) { + if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null; return this.reply ? msg.reply(this.generateText(fromPattern)) : msg.say(this.generateText(fromPattern)); }