Add Character Check in Romaji

This commit is contained in:
dragonfire535
2017-03-03 18:47:48 -05:00
parent 0264350513
commit a419e30fb5
+5 -1
View File
@@ -21,7 +21,11 @@ class RomajiCommand extends commando.Command {
let romajify = message.content.split(" ").slice(1).join(" ");
if(hepburn.containsKana(romajify)) {
let romajified = hepburn.fromKana(romajify);
message.channel.sendMessage(romajified, {split:true});
if(romajified.length > 1900) {
message.channel.sendMessage(":x: Error! Your message is too long!");
} else {
message.channel.sendMessage(romajified);
}
} else {
message.channel.sendMessage(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!");
}