mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 09:12:07 +02:00
Add All Validators.
This commit is contained in:
@@ -26,7 +26,6 @@ module.exports = class YearsCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let user = args.user;
|
||||
if (!user.displayAvatarURL) return message.channel.send(":x: Error! This user has no avatar!");
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace(".jpg", ".png");
|
||||
userAvatar = userAvatar.replace(".gif", ".png");
|
||||
|
||||
@@ -121,13 +121,13 @@ module.exports = class MemeCommand extends commando.Command {
|
||||
}
|
||||
}, {
|
||||
key: 'content',
|
||||
prompt: 'What should the meme content be?',
|
||||
prompt: 'What should the meme content be? Split the bottom and top text of the meme with " | ".',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (content.includes(' | ') && content.match(/^[a-zA-Z0-9|.,!?'-\s]+$/)) {
|
||||
return true;
|
||||
}
|
||||
return 'Please split your choices with ` | ` and do not use special characters.';
|
||||
return 'Please split your choices with " | " and do not use special characters.';
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = class ChooseCommand extends commando.Command {
|
||||
if (content.includes(' | ')) {
|
||||
return true;
|
||||
}
|
||||
return 'Please split your choices with ` | `.';
|
||||
return 'Please split your choices with " | ".';
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
@@ -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