mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 14:21:41 +02:00
Clean-ups
This commit is contained in:
@@ -23,8 +23,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = this.binary(text);
|
||||
return msg.say(converted);
|
||||
return msg.say(this.binary(text));
|
||||
}
|
||||
|
||||
binary(text) {
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = class MockingCommand extends Command {
|
||||
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>`);
|
||||
return msg.say(`${text.join('')} <:sponge:318612443398144000>`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ 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;
|
||||
if (letterTrans(text, dictionary, ' ').length < 2000) return true;
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ module.exports = class MorseCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = letterTrans(text.toLowerCase(), dictionary, ' ');
|
||||
return msg.say(converted);
|
||||
return msg.say(letterTrans(text.toLowerCase(), dictionary, ' '));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class OrganizationXIIINameCommand extends Command {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
text.push('x');
|
||||
const converted = shuffle(text);
|
||||
converted[0] = converted[0].toUpperCase();
|
||||
return msg.say(`\u180E${converted.join('')}`);
|
||||
const shuffled = shuffle(text);
|
||||
shuffled[0] = shuffled[0].toUpperCase();
|
||||
return msg.say(shuffled.join(''));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ 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;
|
||||
if (wordTrans(text, dictionary).length < 2000) return true;
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ module.exports = class PirateCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = wordTrans(text, dictionary);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
return msg.say(wordTrans(text, dictionary));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,11 @@ 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'
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (!text.includes('@everyone') && !text.includes('@here')) return true;
|
||||
return 'Please do not repeat everyone or here mentions.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -19,7 +23,6 @@ module.exports = class RepeatCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = text.repeat(2000).substr(0, 1999);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
return msg.say(text.repeat(2000).substr(0, 2000));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,7 +19,6 @@ module.exports = class ReverseCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = text.split('').reverse().join('');
|
||||
return msg.say(`\u180E${converted}`);
|
||||
return msg.say(text.split('').reverse().join(''));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@ module.exports = class SayCommand extends Command {
|
||||
memberName: 'say',
|
||||
description: 'Make XiaoBot say what you wish.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['MANAGE_MESSAGES'],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
@@ -22,7 +21,7 @@ module.exports = class SayCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
msg.delete();
|
||||
return msg.say(`\u180E${text}`);
|
||||
if (msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) msg.delete();
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,6 @@ module.exports = class ShuffleCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = shuffle(text.split('')).join('');
|
||||
return msg.say(`\u180E${converted}`);
|
||||
return msg.say(shuffle(text.split('')).join(''));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = class TemmieCommand extends Command {
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (wordTrans(text, dictionary).length < 1999) return true;
|
||||
if (wordTrans(text, dictionary).length < 2000) return true;
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ module.exports = class TemmieCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = wordTrans(text, dictionary);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
return msg.say(wordTrans(text, dictionary));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,6 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = letterTrans(text, dictionary);
|
||||
return msg.say(converted);
|
||||
return msg.say(letterTrans(text, dictionary));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,7 +24,6 @@ module.exports = class ZalgoCommand extends Command {
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
const converted = zalgo(text);
|
||||
return msg.say(`\u180E${converted}`);
|
||||
return msg.say(zalgo(text));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user