Christopher
Christopher
Explore posts from servers
CDCloudflare Developers
Created by Christopher on 4/5/2025 in #workers-help
"Handler does not export a scheduled() function" - No matter how it's exported
Howdy, I'm struggling to use the CRON events for my worker; no matter how I export my scheduled fnc, the worker insists it does not exist. As I understand it, the export must be named exactly scheduled, so in my index.ts I have the following:
export const scheduled = async (controller: ScheduledController, env: Env) => {
console.log('Scheduled function triggered:', controller.cron);
};
export const scheduled = async (controller: ScheduledController, env: Env) => {
console.log('Scheduled function triggered:', controller.cron);
};
Yet when the CRON runs, I get Handler does not export a scheduled() function. If I try using export default then I get errors about the handler not having fetch. If I used a named export for fetch and the default for what would be the scheduled, I get a different error again: No event listener registered for scheduled events.. I feel I'm running in circles lol, any input would be appreciated, thanks.
11 replies
DIAdiscord.js - Imagine an app
Created by Christopher on 12/27/2024 in #djs-questions
Sending messages in a Group DM w/ `UserInstall` & `PrivateChannel` w/out Interaction
Greetings, I'm struggling with sending messages to a Group DM outside of interactions. There seems to be no straight forward way (that I've come across) to send a message to a Group DM, so the workaround I found was to use a CommandInteraction and then cache the InteractionWebhook and use that, which worked great... for all of about 15 mins, when I guess Discord culled the Webhook? I suspect I've overcomplicated things; my end goal is simple, I just need to be able to send a message to a Group DM from the Bot User without being tied to an Interaction (i.e. at any time). Cheers, Chris
7 replies
DIAdiscord.js - Imagine an app
Created by Christopher on 8/26/2023 in #djs-questions
discordjs/voice & Basic HTTP Authentication
Howdy, Can I pass a username and password to createAudioResource to satisfy basic http authentication? Or do I need to request the endpoint through something like F🔊🔊etch and then pass the response body to createAudioResource. Thanks!
3 replies