Haha-Yes/commands/general/spoiler.js

40 lines
802 B
JavaScript
Raw Permalink Normal View History

2019-03-07 22:50:40 +01:00
const { Command } = require('discord-akairo');
class spoilerCommand extends Command {
constructor() {
super('spoiler', {
aliases: ['spoiler'],
category: 'general',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES'],
2019-03-07 22:50:40 +01:00
args: [
{
id: 'text',
type: 'string',
2019-06-23 03:41:59 +02:00
prompt: {
start: 'Write something so i can say it back in spoiler',
},
2019-03-07 22:50:40 +01:00
match: 'rest'
}
],
description: {
content: 'Replace every letter in your text with letter spoiler',
usage: 'this is epic',
examples: ['this is epic']
}
});
}
async exec(message, args) {
let text = args.text;
if (!text)
return;
text = text.split('').join('||||');
// Send the final text
2019-03-07 22:52:40 +01:00
message.delete();
2019-03-07 22:50:40 +01:00
return message.channel.send('||' + text + '||');
}
}
module.exports = spoilerCommand;