alchemiztA
Denoβ€’2y agoβ€’
10 replies
alchemizt

follow up action after respond to the request

Currently, i have this for my http interaction discord bot
// ping.js
execute(api: API, interaction: APIPingInteraction): Response {
  something(api, interaction);
  return Response.json({ type: InteractionResponseType.ChannelMessageWithSource, data: { content: "pong" } });
}

async function something(api: API, interaction: APIInteraction): Promise<void> {
  await api.interactions.editReply(interaction.application_id, interaction.token, { content: `${Date.now() - generateTimestamp(interaction)}ms` });
}


is there a way call interactions.editReply in the execute function without creating another function like this? previously i used Deno.serveHttp() to respond to the request, but because its will be deprecated, i moved to Deno.serve
Was this page helpful?