mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 15:57:43 +02:00
msg
This commit is contained in:
@@ -14,16 +14,16 @@ module.exports = class CatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('http://random.cat/meow');
|
||||
return message.channel.send({files: [body.file]});
|
||||
return msg.channel.send({files: [body.file]});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,16 +11,16 @@ module.exports = class DogCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://random.dog/woof.json');
|
||||
return message.channel.send({files: [body.url]});
|
||||
return msg.channel.send({files: [body.url]});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class VocaloidCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const song = songs[Math.floor(Math.random() * songs.length)];
|
||||
return message.say(song);
|
||||
return msg.say(song);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,11 +14,11 @@ module.exports = class XiaoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const xiao = xiaos[Math.floor(Math.random() * xiaos.length)];
|
||||
return message.channel.send({files: [xiao]});
|
||||
return msg.channel.send({files: [xiao]});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user