import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; export default class SpoilerFun extends Command { public constructor() { super('spoiler', { aliases: ['spoiler'], category: 'fun', description: { content: 'Turn every character in a specified phrase as a ||s||||p||||o||||i||||l||||e||||r||.', usage: '[text]', examples: [ 'hide this lol' ] }, ratelimit: 3, args: [ { id: 'text', type: 'string', prompt: { start: 'What would you like to *spoil* (hide)?' }, match: 'rest' }, { id: 'deleteinitialmessage', flag: ['-delete', '-d'], match: 'flag' } ] }); } public exec(msg: Message, { text, deleteinitialmessage }): Promise { if (deleteinitialmessage) msg.delete(); return msg.channel.send(text.replace(/./g, '||$&||')); } }