Braille Command

This commit is contained in:
Daniel Odendahl Jr
2017-10-05 19:13:27 +00:00
parent 5f955fe816
commit c05718deb6
3 changed files with 105 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
const { Command } = require('discord.js-commando');
const { letterTrans } = require('custom-translate');
const dictionary = require('../../assets/json/braille');
module.exports = class BrailleCommand extends Command {
constructor(client) {
super(client, {
name: 'braille',
group: 'text-edit',
memberName: 'braille',
description: 'Converts text to braille.',
args: [
{
key: 'text',
prompt: 'What text would you like to convert to braille?',
type: 'string',
validate: text => {
if (letterTrans(text, dictionary).length < 2000) return true;
return 'Invalid text, your text is too long.';
}
}
]
});
}
run(msg, { text }) {
return msg.say(letterTrans(text, dictionary));
}
};