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/pat.js

45 lines
1.4 KiB
JavaScript
Raw Normal View History

const { Constants } = require('discord.js');
const gifchoices = [
'https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif',
'https://community.gamepress.gg/uploads/default/original/3X/0/a/0a762099c5ad6de9ca5f13dd22a7e45884a99eb3.gif',
'https://media1.giphy.com/media/ARSp9T7wwxNcs/giphy.gif'
];
2021-01-19 18:00:32 -06:00
module.exports = {
2021-01-26 14:03:02 -06:00
name: require('path').parse(__filename).name,
description: 'Pats a user!',
options: [{
name: 'user',
description: 'The user to pat',
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: '<:pats:801238281286713355> Pat',
description: `${taggedUser} You have been patted by ${message.author}!`,
color: 8311585,
footer: {
icon_url: avatarURL,
text: config.footerTxt
},
image: {
url: gif
}
}]
});
2021-01-19 18:00:32 -06:00
}
}
};