Framework Rewrite

This commit is contained in:
Dragon Fire
2021-06-05 12:17:33 -04:00
parent 5c9f237321
commit 7917766ce3
48 changed files with 1101 additions and 294 deletions
+1 -5
View File
@@ -18,11 +18,7 @@ module.exports = class SubredditCommand extends Command {
});
}
async run(msg, { subreddit }, fromPattern) {
if (fromPattern) {
if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null;
subreddit = msg.patternMatches[1];
}
async run(msg, { subreddit }) {
if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit;
try {
const post = await this.random(subreddit, msg.channel.nsfw);