mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Remove the 'meme' command
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
const memes = require("random-memes");
|
||||
const { randomHexColor } = require('../admin/colorgen.js');
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'meme',
|
||||
description: 'Selmer Bot will post a random meme from reddit',
|
||||
async execute(interaction, Discord, Client, bot) {
|
||||
interaction.deferReply();
|
||||
memes.random().then(meme => {
|
||||
|
||||
const newEmbed = new Discord.MessageEmbed()
|
||||
.setColor(randomHexColor())
|
||||
.setTitle(meme.caption)
|
||||
// .setURL(meme.image)
|
||||
.setDescription(`category: ${meme.category}`)
|
||||
.setImage(meme.image);
|
||||
|
||||
interaction.editReply({ embeds: [newEmbed] });
|
||||
}).catch(async err => {
|
||||
console.log(err);
|
||||
//Try a different way
|
||||
const fetch = require('node-fetch');
|
||||
const response = await fetch('https://some-random-api.ml/meme');
|
||||
const data = await response.json().catch(err => {
|
||||
console.log(err);
|
||||
return interaction.reply("_Uh oh, something's gone wrong!_");
|
||||
});
|
||||
|
||||
const newEmbed = new Discord.MessageEmbed()
|
||||
.setColor(randomHexColor())
|
||||
.setTitle(data.caption)
|
||||
// .setURL(data.image)
|
||||
.setDescription(`category: ${data.category}`)
|
||||
.setImage(data.image);
|
||||
|
||||
interaction.editReply({ embeds: [newEmbed] });
|
||||
});
|
||||
}, options: []
|
||||
}
|
||||
Reference in New Issue
Block a user