Fix undefined in meme

This commit is contained in:
Daniel Odendahl Jr
2018-09-04 01:29:56 +00:00
parent fe89641f99
commit 2af879e8a4
+2 -2
View File
@@ -22,8 +22,8 @@ module.exports = class MemeCommand extends Command {
if (!posts.length) return msg.reply(`I couldn't fetch any images from r/${subreddit}...`);
const post = posts[Math.floor(Math.random() * posts.length)];
return msg.say(stripIndents`
**r/${subreddit}** ${post.title}
${post.url}
**r/${subreddit}** ${post.data.title}
${post.data.url}
`);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);