Haha-Yes/commands/general/clap.js

34 lines
711 B
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
2019-02-08 19:08:17 +01:00
const rand = require('../../rand.js');
2018-12-30 01:20:24 +01:00
class ClapCommand extends Command {
2019-01-02 08:09:45 +01:00
constructor() {
super('clap', {
aliases: ['clap'],
category: 'general',
args: [
{
id: 'text',
2019-01-10 20:45:29 +01:00
type: 'string',
match: 'rest'
2019-01-02 08:09:45 +01:00
}
],
description: {
2018-12-30 01:20:24 +01:00
content: 'replace 👏 the 👏 spaces 👏 with 👏 clap 👏',
usage: '[text]',
examples: ['replace the spaces with clap']
}
2019-01-02 08:09:45 +01:00
});
}
2018-12-30 01:20:24 +01:00
2019-01-02 08:09:45 +01:00
async exec(message, args) {
if (!args.text)
return;
2019-02-08 19:08:17 +01:00
args.text = rand.random(args.text, message);
2019-01-02 08:09:45 +01:00
let clap = args.text.replace(/ /g, ' 👏 ');
message.delete();
message.channel.send(`${clap} 👏`);
}
2018-12-30 01:20:24 +01:00
}
module.exports = ClapCommand;