Fix All the Crap

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 04:52:59 +00:00
parent ebfbf31787
commit cb4abd7ac4
12 changed files with 42 additions and 59 deletions
+2 -4
View File
@@ -15,10 +15,7 @@ module.exports = class RomajiCommand extends commando.Command {
args: [{
key: 'kana',
prompt: 'What kana would you like to convert to romaji?',
type: 'string',
validate: (str) => {
hepburn.containsKana(str);
}
type: 'string'
}]
});
}
@@ -29,6 +26,7 @@ module.exports = class RomajiCommand extends commando.Command {
}
console.log(`[Command] ${message.content}`);
let romajify = args.kana;
if (!hepburn.containsKana(romajify)) return message.channel.send(':x: Error! Message contains no Katakana or Hiragana!');
let romajified = hepburn.fromKana(romajify);
if (romajified.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
return message.channel.send(romajified);