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

48 lines
1.4 KiB
JavaScript
Raw Normal View History

2021-01-19 18:00:32 -06:00
module.exports = {
name: "slap",
description: "Slaps an user!",
execute(client, message, args) {
const {footerTxt} = require('../config.json');
2021-01-19 18:00:32 -06:00
const taggedUser = message.mentions.users.first();
//---------------------------------------------------
//---------------------------------------------------
const errorembed = {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
};
if(!taggedUser) {
return message.channel.send({ embed: errorembed});
// Checks if a user was mentioned. If not, returns error message.
}
const embed = {
2021-01-19 18:00:32 -06:00
"title": ":anger: Slap",
2021-01-23 01:08:05 -06:00
"description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!",
2021-02-06 12:15:55 -06:00
"color": 9442302,
2021-01-19 18:00:32 -06:00
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
2021-01-19 18:00:32 -06:00
},
"image": {
"url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943"
}
}
2021-01-23 01:08:05 -06:00
message.channel.send({ embed: embed });
2021-01-19 18:00:32 -06:00
}
}