msg.say files, HTML

This commit is contained in:
Daniel Odendahl Jr
2017-05-16 03:27:31 +00:00
parent 9413bb3008
commit c08a69db7c
24 changed files with 54 additions and 93 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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));
}
};
+2 -2
View File
@@ -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) {