Files
xiao/commands/roleplay/slap.js
T
Daniel Odendahl Jr e105b6aa5d Destructuring Args
2017-04-19 12:21:38 +00:00

27 lines
831 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class SlapCommand extends Command {
constructor(client) {
super(client, {
name: 'slap',
group: 'roleplay',
memberName: 'slap',
description: 'Slaps someone. (;slap @User)',
examples: [';slap @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const { thing } = args;
return message.say(`${message.author} *slaps* ${thing}`);
}
};