Change arg assignment

This commit is contained in:
Daniel Odendahl Jr
2017-09-16 01:44:44 +00:00
parent a4f290f50d
commit 1c9ac56831
135 changed files with 166 additions and 273 deletions
+1 -2
View File
@@ -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, '🅱'));
}
};
+1 -2
View File
@@ -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));
}
+3 -4
View File
@@ -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, ' 👏 '));
}
};
+1 -2
View File
@@ -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} >
+1 -2
View File
@@ -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)
+1 -2
View File
@@ -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, ' '));
}
};
+1 -2
View File
@@ -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>`);
}
+1 -2
View File
@@ -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, ' '));
}
};
+1 -2
View File
@@ -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();
+1 -2
View File
@@ -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));
}
};
+1 -2
View File
@@ -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));
}
};
+1 -2
View File
@@ -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(''));
}
};
+1 -2
View File
@@ -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();
}
+1 -2
View File
@@ -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))}`);
}
};
+1 -2
View File
@@ -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(''));
}
};
+1 -2
View File
@@ -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));
}
};
+1 -2
View File
@@ -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')
+1 -2
View File
@@ -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));
}
};
+1 -2
View File
@@ -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();
}
+1 -2
View File
@@ -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')
+1 -2
View File
@@ -22,8 +22,7 @@ module.exports = class ZalgoCommand extends Command {
});
}
run(msg, args) {
const { text } = args;
run(msg, { text }) {
return msg.say(zalgo(text));
}
};