mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Change arg assignment
This commit is contained in:
@@ -22,8 +22,7 @@ module.exports = class BCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(text.replace(/(b|d|g|p|q)/gi, '🅱'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(this.binary(text));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = class ClapCommand extends Command {
|
||||
prompt: 'What 👏 text 👏 would 👏 you 👏 like 👏 to 👏 convert?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (text.split(' ').join(' 👏 ').length < 2000) return true;
|
||||
if (text.replace(/ /g, ' 👏 ').length < 2000) return true;
|
||||
return 'Invalid text, your text is too long.';
|
||||
}
|
||||
}
|
||||
@@ -22,8 +22,7 @@ module.exports = class ClapCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(text.split(' ').join(' 👏 '));
|
||||
run(msg, { text }) {
|
||||
return msg.say(text.replace(/ /g, ' 👏 '));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class CowsayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.code(null,
|
||||
stripIndent`
|
||||
< ${text} >
|
||||
|
||||
@@ -19,8 +19,7 @@ module.exports = class EmbedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class EmojifyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(letterTrans(text, dictionary, ' '));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,8 +24,7 @@ module.exports = class MockingCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
for (let i = 0; i < text.length; i += Math.floor(Math.random() * 4)) text[i] = text[i].toUpperCase();
|
||||
return msg.say(`${text.join('')} <:sponge:318612443398144000>`);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ module.exports = class MorseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(letterTrans(text, dictionary, ' '));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class OrganizationXIIINameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
text.push('x');
|
||||
const shuffled = shuffle(text);
|
||||
shuffled[0] = shuffled[0].toUpperCase();
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class PirateCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(wordTrans(text, dictionary));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class RepeatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(text.repeat(2000).substr(0, 2000));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,8 +17,7 @@ module.exports = class ReverseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(text.split('').reverse().join(''));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class SayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { text } = args;
|
||||
async run(msg, { text }) {
|
||||
if (msg.channel.type === 'text' && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) {
|
||||
await msg.delete();
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ module.exports = class ShipNameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { start, end } = args;
|
||||
run(msg, { start, end }) {
|
||||
return msg.say(`${start.slice(0, Math.floor(start.length / 2))}${end.slice(Math.floor(end.length / 2))}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class ShuffleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(shuffle(text.split('')).join(''));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class TemmieCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(wordTrans(text, dictionary));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -55,8 +55,7 @@ module.exports = class TranslateCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { text, target, base } = args;
|
||||
async run(msg, { text, target, base }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://translate.yandex.net/api/v1.5/tr.json/translate')
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(letterTrans(text, dictionary));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { content } = args;
|
||||
async run(msg, { content }) {
|
||||
if (msg.channel.type === 'text' && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) {
|
||||
await msg.delete();
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ module.exports = class YodaCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { sentence } = args;
|
||||
async run(msg, { sentence }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('https://yoda.p.mashape.com/yoda')
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class ZalgoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
run(msg, { text }) {
|
||||
return msg.say(zalgo(text));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user