mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add r/subreddit pattern match to subreddit
This commit is contained in:
@@ -16,7 +16,8 @@ module.exports = class SubredditCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { subreddit }) {
|
||||
async run(msg, { subreddit }, fromPattern) {
|
||||
if (fromPattern) 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);
|
||||
|
||||
Reference in New Issue
Block a user