mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 15:57:42 +02:00
Fix Everything
This commit is contained in:
@@ -13,13 +13,9 @@ module.exports = class BinaryCommand extends Command {
|
||||
prompt: 'What text would you like to convert to binary?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (this.binary(text).length < 2000) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
},
|
||||
parse: (text) => this.binary(text)
|
||||
if (this.binary(text).length < 2000) return true;
|
||||
else return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -27,7 +23,8 @@ module.exports = class BinaryCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(text);
|
||||
const converted = this.binary(text);
|
||||
return msg.say(converted);
|
||||
}
|
||||
|
||||
binary(text) {
|
||||
|
||||
@@ -14,11 +14,8 @@ module.exports = class CowsayCommand extends Command {
|
||||
prompt: 'What text would you like the cow to say?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (text.length < 1500) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Invalid Text. Text must be under 1500 characters.';
|
||||
}
|
||||
if (text.length < 1500) return true;
|
||||
else return 'Invalid Text. Text must be under 1500 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class MockingCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'mocking',
|
||||
group: 'textedit',
|
||||
memberName: 'mocking',
|
||||
description: 'I aM a caT, I LIkE To DrInK mILK.',
|
||||
clientPermissions: ['USE_EXTERNAL_EMOJIS'],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'WHaT tEXt WoUlD yOu LiKE to COnvErt?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (text.length < 1950) return true;
|
||||
else return 'Invalid Text. Text must be under 1950 characters.';
|
||||
},
|
||||
parse: (text) => text.split('')
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
for (let i = 0; i < text.length; i += Math.floor(Math.random() * 4)) text[i] = text[i].toUpperCase();
|
||||
return msg.say(`\u180E${text.join('')} <:sponge:318612443398144000>`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,13 +15,9 @@ module.exports = class MorseCommand extends Command {
|
||||
prompt: 'What text would you like to convert to morse?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (letterTrans(text, dictionary, ' ').length < 1999) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
},
|
||||
parse: (text) => letterTrans(text.toLowerCase(), dictionary, ' ')
|
||||
if (letterTrans(text, dictionary, ' ').length < 1999) return true;
|
||||
else return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -29,6 +25,7 @@ module.exports = class MorseCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(text);
|
||||
const converted = letterTrans(text.toLowerCase(), dictionary, ' ');
|
||||
return msg.say(converted);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,13 +15,9 @@ module.exports = class PirateCommand extends Command {
|
||||
prompt: 'What text would you like to convert to pirate?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (wordTrans(text, dictionary).length < 1999) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
},
|
||||
parse: (text) => wordTrans(text, dictionary)
|
||||
if (wordTrans(text, dictionary).length < 1999) return true;
|
||||
else return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -29,6 +25,7 @@ module.exports = class PirateCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(`\u180E${text}`);
|
||||
const converted = wordTrans(text, dictionary);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,7 @@ module.exports = class RepeatCommand extends Command {
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to repeat over and over and over and over?',
|
||||
type: 'string',
|
||||
parse: (text) => text.repeat(2000).substr(0, 1999)
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -20,6 +19,7 @@ module.exports = class RepeatCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(`\u180E${text}`);
|
||||
const converted = text.repeat(2000).substr(0, 1999);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,7 @@ module.exports = class ReverseCommand extends Command {
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to reverse?',
|
||||
type: 'string',
|
||||
parse: (text) => text.split('').reverse().join('')
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -20,6 +19,7 @@ module.exports = class ReverseCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(`\u180E${text}`);
|
||||
const converted = text.split('').reverse().join('');
|
||||
return msg.say(`\u180E${converted}`);
|
||||
}
|
||||
};
|
||||
|
||||
+23
-26
@@ -3,32 +3,29 @@ const { wordTrans } = require('custom-translate');
|
||||
const dictionary = require('../../assets/json/temmie');
|
||||
|
||||
module.exports = class TemmieCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'temmie',
|
||||
group: 'textedit',
|
||||
memberName: 'temmie',
|
||||
description: 'Translate text to Temmie speak.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (wordTrans(text, dictionary).length < 1999) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
},
|
||||
parse: (text) => wordTrans(text, dictionary)
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'temmie',
|
||||
group: 'textedit',
|
||||
memberName: 'temmie',
|
||||
description: 'Translate text to Temmie speak.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (wordTrans(text, dictionary).length < 1999) return true;
|
||||
else return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = wordTrans(text, dictionary);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,11 +24,8 @@ module.exports = class TranslateCommand extends Command {
|
||||
prompt: 'Which language is being translated to?',
|
||||
type: 'string',
|
||||
validate: (to) => {
|
||||
if (codes[to.toLowerCase()]) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Invalid Language Code. Use `help translate` for a list of codes.';
|
||||
}
|
||||
if (codes[to.toLowerCase()]) return true;
|
||||
else return 'Invalid Language Code. Use `help translate` for a list of codes.';
|
||||
},
|
||||
parse: (to) => to.toLowerCase()
|
||||
},
|
||||
@@ -38,11 +35,8 @@ module.exports = class TranslateCommand extends Command {
|
||||
type: 'string',
|
||||
default: '',
|
||||
validate: (from) => {
|
||||
if (codes[from.toLowerCase()]) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Invalid Language Code. Use `help translate` for a list of codes.';
|
||||
}
|
||||
if (codes[from.toLowerCase()]) return true;
|
||||
else return 'Invalid Language Code. Use `help translate` for a list of codes.';
|
||||
},
|
||||
parse: (from) => from.toLowerCase()
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to flip upside-down?',
|
||||
type: 'string',
|
||||
parse: (text) => letterTrans(text, dictionary)
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -23,6 +22,7 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(text);
|
||||
const converted = letterTrans(text, dictionary);
|
||||
return msg.say(converted);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,13 +14,9 @@ module.exports = class ZalgoCommand extends Command {
|
||||
prompt: 'What text would you like to convert to zalgo?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (text.length < 500) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Invalid Text. Text must be under 500 characters.';
|
||||
}
|
||||
},
|
||||
parse: (text) => zalgo(text)
|
||||
if (text.length < 500) return true;
|
||||
else return 'Invalid Text. Text must be under 500 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -28,6 +24,7 @@ module.exports = class ZalgoCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(`\u180E${text}`);
|
||||
const converted = zalgo(text);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user