This commit is contained in:
Daniel Odendahl Jr
2018-02-08 20:22:09 +00:00
parent cfb57291ab
commit bce41f6ef1
4 changed files with 102 additions and 37 deletions
+29
View File
@@ -0,0 +1,29 @@
const { Command } = require('discord.js-commando');
const { letterTrans } = require('custom-translate');
const dictionary = require('../../assets/json/dvorak');
module.exports = class DvorakCommand extends Command {
constructor(client) {
super(client, {
name: 'dvorak',
group: 'text-edit',
memberName: 'dvorak',
description: 'Converts text to Dvorak encoding.',
args: [
{
key: 'text',
prompt: 'What text would you like to convert to Dvorak encoding?',
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));
}
};