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
@@ -41,8 +41,7 @@ module.exports = class HoroscopeCommand extends Command {
});
}
async run(msg, args) {
const { sign } = args;
async run(msg, { sign }) {
try {
const { text } = await snekfetch
.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today/`);
+1 -2
View File
@@ -18,8 +18,7 @@ module.exports = class LMGTFYCommand extends Command {
});
}
run(msg, args) {
const { query } = args;
run(msg, { query }) {
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
}
};
+2 -2
View File
@@ -33,8 +33,8 @@ module.exports = class SoundboardCommand extends Command {
});
}
async run(msg, args) {
const sound = args.sound || sounds[Math.floor(Math.random() * sounds.length)];
async run(msg, { sound }) {
if (!sound) sound = sounds[Math.floor(Math.random() * sounds.length)];
const channel = msg.member.voiceChannel;
if (!channel) return msg.say('Please enter a voice channel first.');
if (!channel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) {
+1 -2
View File
@@ -20,8 +20,7 @@ module.exports = class SpoopyLinkCommand extends Command {
});
}
async run(msg, args) {
const { site } = args;
async run(msg, { site }) {
if (/discord(\.gg|app\.com%2Finvite|\.me)%2F/gi.test(site)) return msg.say('Discord invites are safe!');
try {
const { body } = await snekfetch
+1 -2
View File
@@ -34,8 +34,7 @@ module.exports = class StrawpollCommand extends Command {
});
}
async run(msg, args) {
const { title, options } = args;
async run(msg, { title, options }) {
if (options.length < 2) return msg.say('Please provide more than one choice.');
if (options.length > 31) return msg.say('Please provide thirty or less choices.');
try {
+1 -2
View File
@@ -25,8 +25,7 @@ module.exports = class TagCommand extends Command {
});
}
run(msg, args) {
const { tag } = args;
run(msg, { tag }) {
return msg.say(tags[tag]);
}
};
+1 -2
View File
@@ -23,8 +23,7 @@ module.exports = class XKCDCommand extends Command {
});
}
async run(msg, args) {
const { type } = args;
async run(msg, { type }) {
try {
const current = await snekfetch
.get('https://xkcd.com/info.0.json');