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

40 lines
1.2 KiB
JavaScript

const { ApplicationCommandOptionType } = require('discord.js');
module.exports = {
name: require('path').parse(__filename).name,
description: 'Slaps a user!',
options: [{
name: 'user',
description: 'The user to slap',
required: true,
type: ApplicationCommandOptionType.User
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
return {
embeds: [{
title: ':anger: Slap',
description: `${target} You have been slapped by ${user}!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
},
image: {
url: 'https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943'
}
}]
};
}
};