Files
xiao/commands/text-edit/base64.js
T
Daniel Odendahl Jr 511154ef23 I use base64 a lot
2018-03-05 04:01:20 +00:00

30 lines
668 B
JavaScript

const { Command } = require('discord.js-commando');
const { base64 } = require('../../util/Util');
module.exports = class Base64Command extends Command {
constructor(client) {
super(client, {
name: 'base64',
aliases: ['base-64'],
group: 'text-edit',
memberName: 'base64',
description: 'Converts text to Base64.',
args: [
{
key: 'text',
prompt: 'What text would you like to convert to Base64?',
type: 'string',
validate: text => {
if (base64(text).length < 2000) return true;
return 'Invalid text, your text is too long.';
}
}
]
});
}
run(msg, { text }) {
return msg.say(base64(text));
}
};