kin.ts
kin.ts
DDeno
Created by kin.ts on 2/24/2024 in #help
follow up action after respond to the request
thank you @Leokuma, @cknight . I'll take your advice
11 replies
DDeno
Created by kin.ts on 2/24/2024 in #help
follow up action after respond to the request
the problem is i have to respond to the request before editing the interaction response
11 replies
DDeno
Created by kin.ts on 2/24/2024 in #help
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` });
}
// 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
11 replies
DDeno
Created by kin.ts on 2/24/2024 in #help
follow up action after respond to the request
@Deno AI Helper
11 replies
DDeno
Created by kin.ts on 10/7/2023 in #help
Cannot find module
I tried importing '../api/index.js' but got the error 'module not found', I knew this error would appear, I'm not sure how to import this module (I forked the module from discord.js), so, is there a way to import the ts file as a js file?
5 replies
DDeno
Created by kin.ts on 10/7/2023 in #help
Cannot find module
@Deno AI Helper
5 replies
DDeno
Created by kin.ts on 9/7/2023 in #help
Cannot read file "src/deno.json": not implemented on js
how do i give the --allow-read flag, i'm using deno deploy
4 replies