mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 00:08:06 +02:00
Fix undefined in meme
This commit is contained in:
@@ -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}...`);
|
if (!posts.length) return msg.reply(`I couldn't fetch any images from r/${subreddit}...`);
|
||||||
const post = posts[Math.floor(Math.random() * posts.length)];
|
const post = posts[Math.floor(Math.random() * posts.length)];
|
||||||
return msg.say(stripIndents`
|
return msg.say(stripIndents`
|
||||||
**r/${subreddit}** ${post.title}
|
**r/${subreddit}** ${post.data.title}
|
||||||
${post.url}
|
${post.data.url}
|
||||||
`);
|
`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
|||||||
Reference in New Issue
Block a user