2024-05-23 12:12:07 +00:00
|
|
|
//https://random-d.uk/api/v2/random
|
|
|
|
function returnDuck() {
|
|
|
|
return fetch('https://random-d.uk/api/v2/random')
|
|
|
|
.then(response => response.json())
|
|
|
|
.then(data => data.url);
|
|
|
|
}
|
|
|
|
module.exports = {
|
|
|
|
name: 'duck',
|
|
|
|
description: 'Get a random duck picture',
|
|
|
|
help: 'Get a random duck 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 duck = await returnDuck();
|
|
|
|
message.channel.send(duck);
|
2024-05-23 12:31:32 +00:00
|
|
|
//react 🦆
|
|
|
|
message.react('🦆');
|
2024-05-23 12:12:07 +00:00
|
|
|
},
|
|
|
|
executeSlash: async interaction => {
|
|
|
|
const duck = await returnDuck();
|
|
|
|
interaction.reply(duck);
|
|
|
|
},
|
|
|
|
};
|