Skip to content

Commit

Permalink
Update server.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
shoushou1106 committed Dec 21, 2024
1 parent 52c8ecf commit 67b3523
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ router.post('/', async (request, env: Env) => {
}
);

await fetch(
`https://discord.com/api/v10/webhooks/${env.DISCORD_APPLICATION_ID}/${interaction.token}`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
type: InteractionResponseType.DEFERRED_UPDATE_MESSAGE,
data: {
content: "test update",
},
}),
}
);

if (!initialResponse.ok) {
console.error("Failed to send initial response:", initialResponse.statusText);
return new JsonResponse(
Expand Down

0 comments on commit 67b3523

Please sign in to comment.