Skip to content

Commit

Permalink
fix: märz image not embedding (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
RadNotRed authored Apr 1, 2024
1 parent a346303 commit e0f18a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ puppeteer.launch({
await browser.close();
console.log("Screenshot created")
const form = new FormData();
form.append("file", fs.readFileSync(path.join(`${year}`, `${month}.png`)), `${month.split(" ")[1]}.png`);
const attachmentName = `${month.split(" ")[1].replace("ä", "ae")}.png`
form.append("file", fs.readFileSync(path.join(`${year}`, `${month}.png`)), attachmentName);
form.append("payload_json", JSON.stringify({
embeds: [{
title: `Leaderboard für ${month.split(" ")[1]} ${year}`,
color: 38655, /* #0096ff */
image: {
url: `attachment://${month.split(" ")[1]}.png`
url: `attachment://${attachmentName}`
}
}]
}));
Expand Down

0 comments on commit e0f18a8

Please sign in to comment.