forked from ChrisChrome/weather-bot
I don't like Discord attachments.
This commit is contained in:
parent
fdd435c44a
commit
14faf62e90
19
index.js
19
index.js
|
@ -1234,13 +1234,18 @@ discord.on("interactionCreate", async (interaction) => {
|
||||||
}
|
}
|
||||||
// Returns image, send embed with image as attachment (we need to bypass discord cache)
|
// Returns image, send embed with image as attachment (we need to bypass discord cache)
|
||||||
res.buffer().then(async (buffer) => {
|
res.buffer().then(async (buffer) => {
|
||||||
const attachment = new Discord.MessageAttachment(buffer, `${type}_${day}.png`);
|
const message = {
|
||||||
const embed = {
|
embeds: [{
|
||||||
title: `${toTitleCase(type)} Outlook Day ${day}`,
|
title: `${toTitleCase(type)} Outlook Day ${day}`,
|
||||||
image: {
|
image: {
|
||||||
url: `attachment://${type}_${day}.png`
|
url: `attachment://${type}_${day}.png`
|
||||||
},
|
},
|
||||||
color: 0x00ff00
|
color: 0x00ff00
|
||||||
|
}],
|
||||||
|
files: [{
|
||||||
|
attachment: buffer,
|
||||||
|
name: `${type}_${day}.png`
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
interaction.editReply({ embeds: [embed], files: [attachment] });
|
interaction.editReply({ embeds: [embed], files: [attachment] });
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue