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
@@ -44,7 +44,7 @@ module.exports = class YearsCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -45,7 +45,7 @@ module.exports = class BeautifulCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -48,7 +48,7 @@ module.exports = class BobRossCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -67,7 +67,7 @@ module.exports = class CardCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -47,7 +47,7 @@ module.exports = class GreyscaleCommand extends Command {
const avatarImg = await snekfetch.get(avatarURL);
avatar.src = avatarImg.body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -45,7 +45,7 @@ module.exports = class InvertCommand extends Command {
const avatarImg = await snekfetch.get(avatarURL);
avatar.src = avatarImg.body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -53,7 +53,7 @@ module.exports = class RIPCommand extends Command {
const avatarImg = await snekfetch.get(avatarURL);
avatar.src = avatarImg.body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -45,7 +45,7 @@ module.exports = class SimbaCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class SteamCardCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -51,7 +51,7 @@ module.exports = class TriggeredCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -43,7 +43,7 @@ module.exports = class WantedCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -41,7 +41,7 @@ module.exports = class MemeCommand extends Command {
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
const { type, top, bottom } = args;
return msg.channel.send({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
.catch(err => msg.say(err));
}
};
+1 -1
View File
@@ -15,7 +15,7 @@ module.exports = class SpamCommand extends Command {
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.');
return msg.channel.send({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'spam.png')] })
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'spam.png')] })
.catch(err => msg.say(err));
}
};
+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) {
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class KonachanCommand extends Command {
limit: 1
});
if (!body.length) throw new Error('No Results.');
return msg.channel.send(query ? `Result for ${query}:` : 'Random Image:', { files: [`https:${body[0].file_url}`] })
return msg.say(query ? `Result for ${query}:` : 'Random Image:', { files: [`https:${body[0].file_url}`] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say(err);
+1 -1
View File
@@ -44,7 +44,7 @@ module.exports = class MapCommand extends Command {
size: '500x500',
key: GOOGLE_KEY
});
return msg.channel.send({ files: [{ attachment: body, name: 'map.png' }] })
return msg.say({ files: [{ attachment: body, name: 'map.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say(err);