const allowedPosts = body.data.children.filter((post: {
data: {
over_18: any;
};
}) => !post.data.over_18);
if (!allowedPosts.length) return message.channel.send('It seems we are out of fresh memes!, Try again later.');
const randomIndex = Math.floor(Math.random() * allowedPosts.length)
const embed = new MessageEmbed()
.setTitle(allowedPosts[randomIndex].data.title)
return embed
Just a heads up, I'm working with Discordjs version 13 and TypeScript. My goal is to create a hyperlink for the title that redirects you to the post when clicked.
.setTitle(\`[${allowedPosts[randomIndex].data.title}](https://reddit.com${allowedPosts[randomIndex].data.permalink})\`)
Unfortunately, I encountered an error stating that this function is not callable. Any help would be greatly appreciated. Thank you!