Skip to content

Commit

Permalink
Update contact form API response with footer and timestamp; change av…
Browse files Browse the repository at this point in the history
…atar URL
  • Loading branch information
IgorKowalczyk committed Dec 13, 2024
1 parent cc57ed5 commit 91cd999
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/api/contact/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ export async function POST(request: Request) {
inline: true,
},
],
footer: {
text: "Contact form",
icon_url: "https://igorkowalczyk.dev/assets/avatar.png",
},
timestamp: new Date().toISOString(),
};

try {
const response = await fetch(`${process.env.DISCORD_WEBHOOK_URL}?wait=true`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
username: "igorkowalczykdev",
avatar_url: "https://igorkowalczyk.dev/favicon.ico",
username: "igorkowalczyk.dev",
avatar_url: "https://igorkowalczyk.dev/assets/avatar.png",
embeds: [embed],
}),
});
Expand Down

0 comments on commit 91cd999

Please sign in to comment.