mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Pig Latin Command
This commit is contained in:
@@ -276,6 +276,7 @@ served over 10,000 servers with a uniquely devoted fanbase.
|
||||
* **morse**: Converts text to morse code.
|
||||
* **organization-xiii-name**: Converts a name into the Organization XIII style.
|
||||
* **owo**: OwO.
|
||||
* **pig-latin**: Converts text to pig latin.
|
||||
* **pirate**: Converts text to pirate.
|
||||
* **qr-code**: Converts text to a QR Code.
|
||||
* **repeat**: Repeat text over and over and over and over (etc).
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class PigLatinCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'pig-latin',
|
||||
group: 'text-edit',
|
||||
memberName: 'pig-latin',
|
||||
description: 'Converts text to pig latin.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to pig latin?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (this.pigLatin(text).length < 2000) return true;
|
||||
return 'Invalid text, your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.say(this.pigLatin(text));
|
||||
}
|
||||
|
||||
pigLatin(text) {
|
||||
return text.replace(/\w+/g, this.pigLatinWord).toLowerCase();
|
||||
}
|
||||
|
||||
pigLatinWord(word) {
|
||||
return `${word.slice(1)}${word.charAt(0)}ay`;
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "69.0.1",
|
||||
"version": "69.1.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user