From 892c8e382d15900de3a63cd3f8e0c7e62e64ebde Mon Sep 17 00:00:00 2001 From: Supositware Date: Thu, 7 Mar 2019 22:50:40 +0100 Subject: [PATCH] Put text in spoiler --- commands/general/spoiler.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 commands/general/spoiler.js diff --git a/commands/general/spoiler.js b/commands/general/spoiler.js new file mode 100644 index 00000000..3b278d13 --- /dev/null +++ b/commands/general/spoiler.js @@ -0,0 +1,35 @@ +const { Command } = require('discord-akairo'); + +class spoilerCommand extends Command { + constructor() { + super('spoiler', { + aliases: ['spoiler'], + category: 'general', + args: [ + { + id: 'text', + type: 'string', + 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 + return message.channel.send('||' + text + '||'); + } +} + +module.exports = spoilerCommand; \ No newline at end of file