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

46 lines
1.3 KiB
JavaScript
Raw Normal View History

const { Constants } = require('discord.js');
const gifchoices = [
'https://i.imgur.com/Ns1RBzX.gif',
'https://cdn.lowgif.com/full/2027501b8fa5225c-.gif',
'https://i.gifer.com/36Nx.gif',
'https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif'
];
2021-01-23 01:08:05 -06:00
module.exports = {
2021-01-23 01:08:05 -06:00
name: require('path').parse(__filename).name,
description: 'Noms an user!',
options: [{
name: 'user',
description: 'The user to nom',
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: '<:BlobNomBlob:801241117919805510> Nom',
description: `${taggedUser} You have been nommed by ${message.author}!`,
color: 8311585,
footer: {
icon_url: avatarURL,
text: config.footerTxt
},
image: {
url: gif
}
}]
});
2021-01-19 18:08:38 -06:00
}
}
};