Afaik this is built on top of the browser Cache API so type wouldn't come from Wrangler
Afaik this is built on top of the browser Cache API so type wouldn't come from Wrangler
ctx.waitUntil.fetches (a callback response and a followup message from Discord's Bot API, for context). fetches just fine, but when its running on the cloud, Discord only receives the first request.async fetch(request, env, ctx){
ctx.waitUntil(
// Wrapping it in a promise worked for someone else
new Promise(async function (resolve) {
await runCommand()
return resolve(undefined)
}))
return new Response("Hello World!")
}
async function runCommand(){
await sendCallback() // Discord only recieves this one
// do command stuff
await sendFollowup()
}
async function sendCallback(){ await fetch() }
async function sendFollowup(){ await fetch() }