Haha-Yes/commands/general/clap.js

37 lines
817 B
JavaScript
Raw Permalink 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',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES'],
2019-01-02 08:09:45 +01:00
args: [
{
id: 'text',
2019-01-10 20:45:29 +01:00
type: 'string',
2019-06-23 03:41:59 +02:00
prompt: {
start: 'Write something so i can replace the space with 👏',
},
2019-01-10 20:45:29 +01:00
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.reply(`${clap} 👏`);
2019-01-02 08:09:45 +01:00
}
2018-12-30 01:20:24 +01:00
}
module.exports = ClapCommand;