This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
anitrox/commands/poke.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

const { Constants } = require('discord.js');
const gifchoices = [
'https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif',
'https://i.imgur.com/H7Ok5tn.gif',
'https://media1.tenor.com/images/8fe23ec8e2c5e44964e5c11983ff6f41/tenor.gif?itemid=5600215'
];
module.exports = {
2021-01-26 14:03:02 -06:00
name: require('path').parse(__filename).name,
description: 'Pokes a user!',
options: [{
name: 'user',
description: 'The user to poke',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
}],
async execute (client, message, _, config) {
const taggedUser = message.mentions.users.first();
const avatarURL = message.author.displayAvatarURL();
if (!taggedUser) {
await message.channel.send(client.generateErrorMessage('You need to @mention a user!', avatarURL));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({
embeds: [{
title: '👉 Poke!',
description: `${taggedUser} You have been poked by ${message.author}!`,
color: 8311585,
footer: {
icon_url: avatarURL,
text: config.footerTxt
},
image: {
url: gif
}
}]
});
}
}
};