Allow video memes in meme

This commit is contained in:
Daniel Odendahl Jr
2018-10-04 23:33:53 +00:00
parent ef23bd1b7d
commit 1f1708536c
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "92.2.3",
"version": "92.2.4",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {
+2 -2
View File
@@ -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 {