From 1902ff559bd6b994397a2ecdfcf2f1c611160820 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 18 May 2019 16:09:32 +0200 Subject: [PATCH] asciify --- commands/fun/asciify.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 commands/fun/asciify.js diff --git a/commands/fun/asciify.js b/commands/fun/asciify.js new file mode 100644 index 00000000..e7fc0337 --- /dev/null +++ b/commands/fun/asciify.js @@ -0,0 +1,37 @@ +const { Command } = require('discord-akairo'); +const asciify = require('asciify-image'); + +let options = { + fit: 'box', + width: 200, + height: 50, + color: false +}; + +class asciifyCommand extends Command { + constructor() { + super('asciify', { + aliases: ['asciify'], + category: 'fun', + cooldown: 600000, + ratelimit: 2, + description: { + content: 'Transform your image into ascii (ATTENTION, SPAM!)', + usage: '[image in attachment]', + examples: ['image in attachment'] + } + }); + } + + async exec(message) { + let Attachment = (message.attachments).array(); + + + return asciify(Attachment[0].url, options, function (err, asciified) { + if (err) throw err; + // Print to console + return message.channel.send(asciified, { split: true, code: true }); + }); + } +} +module.exports = asciifyCommand; \ No newline at end of file