mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 14:18:36 +02:00
msg.say files, HTML
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class CatCommand extends Command {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://random.cat/meow');
|
||||
return msg.channel.send({ files: [body.file] })
|
||||
return msg.say({ files: [body.file] })
|
||||
.catch(err => msg.say(err));
|
||||
} catch (err) {
|
||||
return msg.say(err);
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = class DogCommand extends Command {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://random.dog/woof.json');
|
||||
return msg.channel.send({ files: [body.url] })
|
||||
return msg.say({ files: [body.url] })
|
||||
.catch(err => msg.say(err));
|
||||
} catch (err) {
|
||||
return msg.say(err);
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = class XiaoCommand extends Command {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const xiao = Math.floor(Math.random() * 10) + 1;
|
||||
return msg.channel.send({ files: [path.join(__dirname, '..', '..', 'assets', 'images', `xiaopai${xiao}.png`)] })
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', `xiaopai${xiao}.png`)] })
|
||||
.catch(err => msg.say(err));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,13 +31,13 @@ module.exports = class XKCDCommand extends Command {
|
||||
try {
|
||||
const current = await snekfetch
|
||||
.get('https://xkcd.com/info.0.json');
|
||||
if (type === 'today') return msg.channel.send({ files: [current.body.img] })
|
||||
if (type === 'today') return msg.say({ files: [current.body.img] })
|
||||
.catch(err => msg.say(err));
|
||||
else {
|
||||
const random = Math.floor(Math.random() * current.body.num) + 1;
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${random}/info.0.json`);
|
||||
return msg.channel.send({ files: [body.img] })
|
||||
return msg.say({ files: [body.img] })
|
||||
.catch(err => msg.say(err));
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user