mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Framework Rewrite
This commit is contained in:
@@ -8,9 +8,9 @@ module.exports = class AutoReplyCommand extends Command {
|
||||
this.throttling = null;
|
||||
}
|
||||
|
||||
run(msg, args, fromPattern) {
|
||||
run(msg) {
|
||||
if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null;
|
||||
const text = this.generateText(fromPattern);
|
||||
const text = this.generateText();
|
||||
if (!text) return null;
|
||||
return this.reply ? msg.reply(text) : msg.say(text);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user