diff --git a/commands/other/cleverbot.js b/commands/other/cleverbot.js index 1108b68f..940bc160 100644 --- a/commands/other/cleverbot.js +++ b/commands/other/cleverbot.js @@ -35,7 +35,10 @@ module.exports = class CleverbotCommand extends Command { } async run(msg, { text }, fromPattern) { - if (fromPattern) text = msg.patternMatches[2]; + if (fromPattern) { + if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null; + text = msg.patternMatches[2]; + } try { const convo = this.convos.get(msg.channel.id); const { body } = await request diff --git a/structures/commands/Subreddit.js b/structures/commands/Subreddit.js index 92471a4e..bbe5cb63 100644 --- a/structures/commands/Subreddit.js +++ b/structures/commands/Subreddit.js @@ -19,7 +19,10 @@ module.exports = class SubredditCommand extends Command { } async run(msg, { subreddit }, fromPattern) { - if (fromPattern) subreddit = msg.patternMatches[1]; + if (fromPattern) { + if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null; + subreddit = msg.patternMatches[1]; + } if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit; try { const post = await this.random(subreddit, msg.channel.nsfw);