diff --git a/src/commands/about.js b/src/commands/about.js index 64777b7..b896e4e 100644 --- a/src/commands/about.js +++ b/src/commands/about.js @@ -3,7 +3,8 @@ const { Command } = require('discord-akairo'); class AboutCommand extends Command { constructor() { super('about', { - aliases: ['about'] + aliases: ['about'], + clientPermissions: ['SEND_MESSAGES'] }); } diff --git a/src/commands/eval.js b/src/commands/eval.js index 29e7b35..7f75291 100644 --- a/src/commands/eval.js +++ b/src/commands/eval.js @@ -7,6 +7,7 @@ class EvalCommand extends Command { aliases: ['eval', 'e'], ownerOnly: true, quoted: false, + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'code', diff --git a/src/commands/help.js b/src/commands/help.js index d1a8c47..bce5de6 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -3,7 +3,8 @@ const { Command } = require('discord-akairo'); class HelpCommand extends Command { constructor() { super('help', { - aliases: ['help'] + aliases: ['help'], + clientPermissions: ['SEND_MESSAGES'] }); } diff --git a/src/commands/ping.js b/src/commands/ping.js index 5f0cab6..09b4c9b 100644 --- a/src/commands/ping.js +++ b/src/commands/ping.js @@ -3,7 +3,8 @@ const { Command } = require('discord-akairo'); class PingCommand extends Command { constructor() { super('ping', { - aliases: ['ping'] + aliases: ['ping'], + clientPermissions: ['SEND_MESSAGES'] }); } diff --git a/src/commands/reload.js b/src/commands/reload.js index 6092206..12769e8 100644 --- a/src/commands/reload.js +++ b/src/commands/reload.js @@ -6,6 +6,7 @@ class ReloadCommand extends Command { aliases: ['reload', 'r'], ownerOnly: true, quoted: false, + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'type', diff --git a/src/listeners/error.js b/src/listeners/error.js index 1fce7c0..17857d3 100644 --- a/src/listeners/error.js +++ b/src/listeners/error.js @@ -10,7 +10,11 @@ class ErrorListener extends Listener { } exec(err, message) { - message.util.send([ + if (message.guild && !message.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) { + return null; + } + + return message.util.send([ 'An error occured:', '```', err.toString(), diff --git a/src/listeners/messageInvalid.js b/src/listeners/messageInvalid.js index 4f8979b..dfaedc2 100644 --- a/src/listeners/messageInvalid.js +++ b/src/listeners/messageInvalid.js @@ -11,6 +11,10 @@ class MessageInvalidListener extends Listener { } async exec(message) { + if (message.guild && !message.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) { + return null; + } + const parse = this.parseMessage(message); if (!parse) { return null;