mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Change arg assignment
This commit is contained in:
@@ -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/`);
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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'])) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class TagCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
run(msg, { tag }) {
|
||||
return msg.say(tags[tag]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user