Nicer args parse

This commit is contained in:
Daniel Odendahl Jr
2017-04-23 23:27:03 +00:00
parent 678d3d3ae8
commit 11a610ab5e
28 changed files with 37 additions and 95 deletions
+3 -5
View File
@@ -1,5 +1,5 @@
const { Command } = require('discord.js-commando');
const translator = require('custom-translate');
const { wordTrans } = require('custom-translate');
const dictionary = require('./temmiewords.json');
module.exports = class TemmieCommand extends Command {
@@ -14,14 +14,12 @@ module.exports = class TemmieCommand extends Command {
prompt: 'What text would you like to convert to Temmie speak?',
type: 'string',
validate: content => {
if (translator.wordTrans(content, dictionary).length < 1999) {
if (wordTrans(content, dictionary).length < 1999) {
return true;
}
return 'Your message content is too long.';
},
parse: text => {
return translator.wordTrans(text, dictionary);
}
parse: text => wordTrans(text, dictionary)
}]
});
}