How to use a webhook callback as in fetch event listener handler but for esm

How can I rewrite this into an export default {}? I need to be able to await the getBot function, but also I didn’t manage to set up the callback using the esm way

  async function(){
    addEventListener("fetch", webhookCallback( await getBot() , "cloudflare"));
    addEventListener("scheduled", (e : ScheduledEvent)=>{
        switch (e.cron) {
            case "*/30 * * * *":
                console.log('dispatch cron')