mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
Add All Validators.
This commit is contained in:
@@ -12,7 +12,13 @@ module.exports = class BinaryCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to binary?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (stringToBinary(content).length > 1950) {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -24,7 +30,6 @@ module.exports = class BinaryCommand extends commando.Command {
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let turnToBinary = args.text;
|
||||
let binaryText = stringToBinary(turnToBinary);
|
||||
if (binaryText.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
|
||||
return message.channel.send(binaryText);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = class MorseCommand extends commando.Command {
|
||||
}
|
||||
}, {
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to morse?',
|
||||
prompt: 'What text would you like to convert to/from morse?',
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
|
||||
@@ -16,7 +16,13 @@ module.exports = class PirateCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to pirate?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (pirateSpeak.translate(content).length > 1950) {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ module.exports = class RomajiCommand extends commando.Command {
|
||||
type: 'string',
|
||||
validate: kana => {
|
||||
if (hepburn.containsKana(kana)) {
|
||||
if (hepburn.fromKana(kana).length > 1950) {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return 'Please enter text in either Hiragana or Katakana.';
|
||||
@@ -33,7 +36,6 @@ module.exports = class RomajiCommand extends commando.Command {
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let romajify = args.kana;
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -297,7 +297,13 @@ module.exports = class TemmieCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (temmize(content).length > 1950) {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,13 @@ module.exports = class ZalgoCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to zalgo?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (zalgo(content).length > 1950) {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -23,7 +29,6 @@ module.exports = class ZalgoCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let zalgoified = zalgo(args.text);
|
||||
if (zalgoified.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
|
||||
return message.channel.send(zalgoified);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user