From c45035009424c8ee89c2dfe05398bbf3768e79f6 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 17 Apr 2017 17:05:57 +0000 Subject: [PATCH] send instead of sendFile for buffers --- commands/avataredit/3000years.js | 2 +- commands/avataredit/beautiful.js | 2 +- commands/avataredit/bobross.js | 2 +- commands/avataredit/rip.js | 2 +- commands/avataredit/steamcard.js | 2 +- commands/search/map.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index be80b929..4ab69c92 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -37,7 +37,7 @@ module.exports = class YearsCommand extends Command { years.blit(avatar, 461, 127); years.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: {attachment: buff} }); }); } }; diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index a4b3c7dd..781579df 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -39,7 +39,7 @@ module.exports = class BeautifulCommand extends Command { beautiful.blit(avatar, 451, 434); beautiful.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: {attachment: buff} }); }); } }; diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index a37aec56..1db8d2ad 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -41,7 +41,7 @@ module.exports = class BobRossCommand extends Command { nothing.composite(bob, 0, 0); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: {attachment: buff} }); }); } }; diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index a96774ae..8326f74a 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -38,7 +38,7 @@ module.exports = class RIPCommand extends Command { gravestone.blit(avatar, 60, 65); gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: {attachment: buff} }); }); } }; diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index 3c4aea4c..dccf89a3 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -42,7 +42,7 @@ module.exports = class SteamCardCommand extends Command { nothing.print(font, 38, 20, userDisplayName); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: {attachment: buff} }); }); } }; diff --git a/commands/search/map.js b/commands/search/map.js index 9db0dd36..b71860e6 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -40,7 +40,7 @@ module.exports = class MapCommand extends Command { try { const response = await snekfetch .get(`https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`); - return message.channel.sendFile(response.body); + return message.channel.send({file: {attachment: response.body} }); } catch (err) { return message.say(':x: Error! Something went wrong! Make sure you entered the location correctly!');