2021-09-06 12:38:25 +02:00
|
|
|
const { MessageEmbed } = require("discord.js");
|
2021-09-17 18:28:39 +02:00
|
|
|
const { getreddit } = require("cath");
|
2021-09-06 12:38:25 +02:00
|
|
|
module.exports = {
|
|
|
|
name: "meme",
|
|
|
|
category: "Fun",
|
|
|
|
description: "Get a meme from reddit",
|
|
|
|
run: async (client, interaction, args) => {
|
|
|
|
let subreddits = ["comedyheaven", "dank", "meme", "memes"];
|
|
|
|
let subreddit = subreddits[Math.floor(Math.random() * subreddits.length)];
|
2021-09-17 18:28:39 +02:00
|
|
|
const data = await getreddit(subreddit);
|
|
|
|
await interaction.followUp({
|
|
|
|
embeds: [
|
|
|
|
new MessageEmbed({
|
|
|
|
title: data.title,
|
|
|
|
url: data.url,
|
|
|
|
image: { url: data.image },
|
|
|
|
timestamp: Date.now(),
|
|
|
|
footer: { text: data.footer },
|
|
|
|
color: client.color,
|
|
|
|
author: {
|
|
|
|
name: interaction.member.user.tag,
|
|
|
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
});
|
2021-09-06 12:38:25 +02:00
|
|
|
},
|
|
|
|
};
|