diff options
Diffstat (limited to 'server/src/commands/fun/Spoiler.ts')
| -rw-r--r-- | server/src/commands/fun/Spoiler.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/server/src/commands/fun/Spoiler.ts b/server/src/commands/fun/Spoiler.ts new file mode 100644 index 0000000..fb061f9 --- /dev/null +++ b/server/src/commands/fun/Spoiler.ts @@ -0,0 +1,39 @@ +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<Message> { + if (deleteinitialmessage) msg.delete(); + return msg.channel.send(text.replace(/./g, '||$&||')); + } +}
\ No newline at end of file |