Bot-2.0/commands/fox.js

29 lines
754 B
JavaScript
Raw Normal View History

2024-05-23 09:22:31 +00:00
function returnCat() {
return fetch('https://randomfox.ca/floof/')
.then(response => response.json())
.then(data => data.image);
}
module.exports = {
name: 'fox',
description: 'Get a random fox picture',
help: 'Get a random fox picture',
options: [],
slash: true,
text: true,
admin: false,
requireKick: false,
requireBan: false,
canBeUsedInDm: true,
premium: false,
contexts: ['GUILD_TEXT', 'GUILD_VOICE', 'DM'],
integration_types: [0,1],
execute: async (message, args) => {
const cat = await returnCat();
message.channel.send(cat);
},
executeSlash: async interaction => {
const cat = await returnCat();
interaction.reply(cat);
},
};