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() }
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() }