mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Allow video memes in meme
This commit is contained in:
@@ -12,7 +12,7 @@ module.exports = class MemeCommand extends SubredditCommand {
|
||||
description: 'Responds with a random meme.',
|
||||
details: `**Subreddits:** ${subreddits.join(', ')}`,
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
postType: 'image',
|
||||
postType: ['image', 'rich:video'],
|
||||
args: [
|
||||
{
|
||||
key: 'subreddit',
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "92.2.3",
|
||||
"version": "92.2.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = class SubredditCommand extends Command {
|
||||
super(client, info);
|
||||
|
||||
this.subreddit = info.subreddit;
|
||||
this.postType = info.postType;
|
||||
this.postType = Array.isArray(info.postType) ? info.postType : [info.postType];
|
||||
}
|
||||
|
||||
async run(msg, { subreddit }) {
|
||||
@@ -38,7 +38,7 @@ module.exports = class SubredditCommand extends Command {
|
||||
const posts = body.data.children.filter(post => {
|
||||
if (!post.data) return false;
|
||||
if (!nsfw && post.data.over_18) return false;
|
||||
return (this.postType ? post.data.post_hint === this.postType : true) && post.data.url && post.data.title;
|
||||
return (this.postType ? this.postType.includes(post.data.post_hint) : true) && post.data.url && post.data.title;
|
||||
});
|
||||
if (!posts.length) return null;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user