Haha-Yes/commands/fun/asciify.js

38 lines
880 B
JavaScript
Raw Normal View History

2019-05-18 16:09:32 +02:00
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',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES'],
2019-05-18 16:09:32 +02:00
cooldown: 600000,
ratelimit: 2,
description: {
2020-06-15 17:56:51 +02:00
content: 'Transform your image into ASCII! (This can be a bit spammy, so be careful!)',
2019-05-18 16:09:32 +02:00
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;