send instead of sendFile for buffers

This commit is contained in:
Daniel Odendahl Jr
2017-04-17 17:05:57 +00:00
parent e0feffd18e
commit c450350094
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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} });
});
}
};
+1 -1
View File
@@ -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} });
});
}
};
+1 -1
View File
@@ -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} });
});
}
};
+1 -1
View File
@@ -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} });
});
}
};
+1 -1
View File
@@ -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} });
});
}
};
+1 -1
View File
@@ -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!');