Errors
Every error discord0 throws or logs starts with a stable code in brackets, followed by what went wrong, why, and how to fix it:
[DUPLICATE_COMMAND] Duplicate command: ban Why: Discord identifies a command by its name and type, so the second definition would replace the first when commands sync. Fix: Rename one of them, or move one into a sub-app mounted with `app.route()` so it becomes a subcommand. Docs: https://github.com/natebabyak/discord0/blob/main/packages/discord0/ERRORS.md#duplicate_commandThrown errors are Discord0Error instances (or subclasses such as
ValidationError and InteractionAlreadyRepliedError) with code,
detail, why, fix, and docs properties. Match on code, which never
changes between releases, rather than on the message:
import { Discord0Error } from "discord0";
try { app.command("ban", "Ban a member", ban);} catch (error) { if (error instanceof Discord0Error && error.code === "DUPLICATE_COMMAND") { // ... }}Errors from Discord’s API are DiscordAPIError instances instead, with
Discord’s status, numeric code, and errors, plus a hint for common
codes. See DISCORD_API_ERROR.
This page is generated from packages/discord0/src/errors.ts. A copy ships in
the package at node_modules/discord0/ERRORS.md.
- App setup: INVALID_APP_OPTION, APP_SEALED
- Commands: INVALID_COMMAND_NAME, INVALID_DESCRIPTION, DUPLICATE_COMMAND, TOO_MANY_COMMANDS, TOO_MANY_SUBCOMMANDS, EMPTY_COMMAND_GROUP, COMMAND_TOO_DEEP, SUBCOMMAND_FIELD, COMMAND_TOO_LARGE, DUPLICATE_AUTOCOMPLETE, INVALID_COMMAND_OPTIONS
- Sub-apps: INVALID_MOUNT, SUB_APP_CONFIGURED, MOUNT_CONTEXT_MENU
- Components and modals: INVALID_CUSTOM_ID_TEMPLATE, INVALID_CUSTOM_ID, DUPLICATE_HANDLER, INVALID_COMPONENT
- Responding to interactions: ALREADY_ACKNOWLEDGED, NOT_ACKNOWLEDGED, EPHEMERAL_MISMATCH, MODAL_WITHOUT_MESSAGE, INVALID_AUTOCOMPLETE_CHOICES
- Scheduled tasks: INVALID_TASK, INVALID_CRON, INVALID_TIMEZONE, DUPLICATE_TASK, UNKNOWN_TASK, NO_SCHEDULED_TASK, TASKS_UNSUPPORTED
- Webhooks and events: INVALID_WEBHOOK, WEBHOOK_NEEDS_VERIFY, PATH_CONFLICT, MISSING_HANDLER, INVALID_EVENT_TYPE, INVALID_EVENT_BODY, INVALID_WEBHOOK_URL
- Credentials and REST: MISSING_PUBLIC_KEY, INVALID_PUBLIC_KEY, MISSING_BOT_TOKEN, APPLICATION_NOT_FOUND, INVALID_REST_REQUEST, INVALID_REST_OPTION, DISCORD_API_ERROR
- Deploy and CLI: INVALID_CONFIG, GUILD_REQUIRED, ADAPTER_REQUIRED, ADAPTER_NOT_FOUND, INVALID_ADAPTER, INVALID_ENTRY, APP_LOAD_FAILED, BUILD_FAILED, UNSUPPORTED_RUNTIME, ADAPTER_FAILED, INIT_FAILED
- Testing: INVALID_TEST_INPUT
- Runtime logs: HANDLER_FAILED, BACKGROUND_WORK_FAILED, WEBHOOK_VERIFY_FAILED, WEBHOOK_SECRET_UNSET
App setup
Section titled “App setup”INVALID_APP_OPTION
Section titled “INVALID_APP_OPTION”What you see: An option passed to new Discord() is out of range.
Why: discord0 checks options when the app is built, so a bad value fails at startup rather than on the first interaction.
Fix: Correct the option named in the message. autoDeferAfterMs must be from 0 to 2999, since Discord drops interactions that aren’t answered within 3 seconds.
new Discord({ autoDeferAfterMs: 2000 });APP_SEALED
Section titled “APP_SEALED”What you see: A handler was registered on a sub-app after it was mounted.
Why: app.route() copies a sub-app’s commands, components, tasks, and webhooks when it mounts it. Later registrations would be silently lost, so the sub-app is sealed instead.
Fix: Register every handler on the sub-app before passing it to app.route(), and mount inner sub-apps before outer ones.
const tickets = new Discord().command("open", "Open a ticket", () => "Opened");app.route("ticket", "Manage tickets", tickets); // mount lastCommands
Section titled “Commands”INVALID_COMMAND_NAME
Section titled “INVALID_COMMAND_NAME”What you see: A command, subcommand, or group name breaks Discord’s naming rules.
Why: Discord rejects slash command names that aren’t 1-32 lowercase letters, digits, -, or _, and the whole sync fails.
Fix: Rename it to lowercase without spaces, such as "open-ticket". Show a different name per language with name_localizations.
INVALID_DESCRIPTION
Section titled “INVALID_DESCRIPTION”What you see: A slash command or subcommand is missing its description, or it is too long.
Why: Discord requires every slash command, subcommand, and group to have a description of 1-100 characters.
Fix: Pass a description as the second argument, or as description in the config object.
app.command("ping", "Replies with Pong!", () => "Pong!");DUPLICATE_COMMAND
Section titled “DUPLICATE_COMMAND”What you see: Two commands of the same type share a name.
Why: Discord identifies a command by its name and type, so the second definition would replace the first when commands sync.
Fix: Rename one of them, or move one into a sub-app mounted with app.route() so it becomes a subcommand.
TOO_MANY_COMMANDS
Section titled “TOO_MANY_COMMANDS”What you see: The app defines more commands of one type than Discord allows.
Why: Discord allows 100 slash commands, 15 user commands, and 15 message commands per app.
Fix: Group related slash commands into sub-apps with app.route(). Each mount counts as one command and can hold 25 subcommands or groups.
TOO_MANY_SUBCOMMANDS
Section titled “TOO_MANY_SUBCOMMANDS”What you see: A command or group has more than 25 subcommands and groups.
Why: Discord allows at most 25 options, including subcommands and groups, on each level of a command.
Fix: Split the sub-app into groups by mounting smaller sub-apps inside it with route().
EMPTY_COMMAND_GROUP
Section titled “EMPTY_COMMAND_GROUP”What you see: A mounted sub-app has no slash commands.
Why: Mounting with a name turns the sub-app’s commands into subcommands, and Discord rejects a command with no subcommands.
Fix: Register at least one command() on the sub-app before mounting it, or mount it without a name: app.route(subApp).
COMMAND_TOO_DEEP
Section titled “COMMAND_TOO_DEEP”What you see: Commands nest deeper than command → group → subcommand.
Why: Discord supports at most two levels below a command: a group and its subcommands.
Fix: Flatten the tree. Mount sub-apps at most twice deep, and don’t put Subcommand options in options yourself; mount a sub-app instead.
SUBCOMMAND_FIELD
Section titled “SUBCOMMAND_FIELD”What you see: A subcommand sets a field only top-level commands support.
Why: Fields such as default_member_permissions, contexts, and nsfw apply to a whole top-level command, so Discord ignores or rejects them on subcommands.
Fix: Set the field on the mount instead.
app.route( { name: "mod", description: "Moderation", default_member_permissions: "8" }, moderation,);COMMAND_TOO_LARGE
Section titled “COMMAND_TOO_LARGE”What you see: A command’s names, descriptions, and choices exceed 8000 characters.
Why: Discord caps each top-level command, counting all its subcommands, options, choices, and localizations, at 8000 characters.
Fix: Shorten descriptions, move choices to autocomplete, or split the command into several top-level commands.
DUPLICATE_AUTOCOMPLETE
Section titled “DUPLICATE_AUTOCOMPLETE”What you see: Two autocomplete handlers target the same command.
Why: Each command path gets one autocomplete handler, which answers for every option of that command.
Fix: Keep one handler and branch on c.focused?.name to answer for each option.
app.autocomplete("ticket open", (c) => c.focused?.name === "team" ? teams : priorities,);INVALID_COMMAND_OPTIONS
Section titled “INVALID_COMMAND_OPTIONS”What you see: An interaction’s options don’t match the command’s definition.
Why: The command registered with Discord differs from the one in your code, usually because commands haven’t been synced since the definition changed. discord0 rejects the interaction rather than hand your handler bad data.
Fix: Sync commands again with discord0 sync (or restart discord0 dev). Until then, users see the generic messages.error reply.
Sub-apps
Section titled “Sub-apps”INVALID_MOUNT
Section titled “INVALID_MOUNT”What you see: app.route() was called with something it can’t mount.
Why: route() takes a sub-app built with new Discord(), optionally after a name and description or a config object. A sub-app takes its options from its own commands.
Fix: Pass the sub-app as the last argument, don’t mount an app into itself, and leave options and type off the mount config.
app.route("ticket", "Manage tickets", tickets);app.route(misc); // no name: its commands stay top-levelSUB_APP_CONFIGURED
Section titled “SUB_APP_CONFIGURED”What you see: A sub-app has constructor options or lifecycle hooks.
Why: Only the main app serves requests, so options such as publicKey and hooks such as onError on a sub-app would never run.
Fix: Create sub-apps with new Discord() and no options, and set beforeHandle, afterHandle, and onError on the main app.
MOUNT_CONTEXT_MENU
Section titled “MOUNT_CONTEXT_MENU”What you see: A sub-app with context menu commands was mounted under a name.
Why: Discord doesn’t allow user and message commands as subcommands.
Fix: Mount it without a name, app.route(subApp), or move the context menu commands to the main app.
Components and modals
Section titled “Components and modals”INVALID_CUSTOM_ID_TEMPLATE
Section titled “INVALID_CUSTOM_ID_TEMPLATE”What you see: A custom ID template such as approve:{id} is malformed.
Why: Templates are :-separated literal and {param} segments. Each segment must be non-empty, parameter names must be unique, and the template must fit in Discord’s 100-character custom ID.
Fix: Fix the template named in the message. A template with no {param} is just an ID: register the exact string instead, such as "refresh".
app.component("approve:{id}", (c) => c.update(`Approved ${c.params.id}`));INVALID_CUSTOM_ID
Section titled “INVALID_CUSTOM_ID”What you see: CustomId.id() got parameters it can’t encode.
Why: Every parameter needs a non-empty value without :, the separator, and the result must fit in Discord’s 100 characters.
Fix: Pass every parameter, encode values that may contain : (for example with encodeURIComponent), and keep values short: store large state elsewhere and put its key in the ID.
DUPLICATE_HANDLER
Section titled “DUPLICATE_HANDLER”What you see: Two component or modal handlers claim the same custom ID.
Why: discord0 routes each incoming custom ID to exactly one handler; with two candidates the choice would be arbitrary.
Fix: Give each handler its own custom ID or template. Templates overlap when one ID could match both, such as vote:{id} and vote:{choice}; add a distinct literal segment, such as vote:up:{id}.
INVALID_COMPONENT
Section titled “INVALID_COMPONENT”What you see: A message component or modal breaks Discord’s component rules.
Why: Discord rejects the whole message when one component is invalid, and its error is hard to trace back. discord0 checks components before sending them so the message names the exact field.
Fix: Correct the component field named in the message. Components v2 messages (with MessageFlags.IsComponentsV2) can’t also set content, embeds, poll, or stickers.
Responding to interactions
Section titled “Responding to interactions”ALREADY_ACKNOWLEDGED
Section titled “ALREADY_ACKNOWLEDGED”What you see: A handler replied to an interaction twice.
Why: Discord accepts exactly one initial response per interaction. Later messages must edit the reply or send follow-ups.
Fix: Use c.editReply() to change the reply, or c.followUp() to send another message. Returning a value from a handler also replies, so don’t both await c.reply() and return a string.
app.command("slow", "Slow command", async (c) => { await c.defer(); await c.editReply(await work());});NOT_ACKNOWLEDGED
Section titled “NOT_ACKNOWLEDGED”What you see: A handler edited or followed up on an interaction it hasn’t answered.
Why: Edits and follow-ups act on the original response, which doesn’t exist until the interaction is acknowledged with a message.
Fix: Call c.reply() or c.defer() first. After c.showModal(), answer from the modal’s handler instead.
EPHEMERAL_MISMATCH
Section titled “EPHEMERAL_MISMATCH”What you see: A deferred public reply was finished as ephemeral.
Why: Discord fixes a reply’s visibility when it is deferred, so a later reply can’t change it.
Fix: Defer with the visibility you need, c.defer(true) for ephemeral, or send the private message as an ephemeral follow-up.
MODAL_WITHOUT_MESSAGE
Section titled “MODAL_WITHOUT_MESSAGE”What you see: update() or deferUpdate() was called on a modal not opened from a message.
Why: Only a modal opened from a message component has a message to update. A modal opened from a slash command has none.
Fix: Check c.interaction.message first, or c.reply() instead.
INVALID_AUTOCOMPLETE_CHOICES
Section titled “INVALID_AUTOCOMPLETE_CHOICES”What you see: Autocomplete choices break Discord’s rules.
Why: Discord shows at most 25 choices, and every choice in one response must have the option’s type: all strings or all finite numbers.
Fix: Return at most 25 choices with .slice(0, 25), and give every choice a value of the option’s type.
Scheduled tasks
Section titled “Scheduled tasks”INVALID_TASK
Section titled “INVALID_TASK”What you see: A task’s name or handler is invalid.
Why: Task names become host resource names (Cloudflare Cron Triggers, EventBridge schedules, Netlify functions), so they’re limited to 1-64 lowercase letters, digits, -, and _.
Fix: Use a name such as daily-digest, and pass a handler function as the last argument.
app.task("daily-digest", "0 9 * * *", (c) => c.send(channelId, "Digest"));INVALID_CRON
Section titled “INVALID_CRON”What you see: A task’s cron expression uses syntax not every host supports.
Why: discord0 deploys the same schedule to six hosts, so it accepts only what they all share: five fields of numbers, *, lists, ranges, and steps. Days of the week run from 0 (Sunday) to 6.
Fix: Rewrite names such as MON as numbers (1), and @daily as 0 0 * * *. L, W, #, and ? have no portable equivalent.
INVALID_TIMEZONE
Section titled “INVALID_TIMEZONE”What you see: A task’s timezone isn’t an IANA time zone.
Why: Hosts that honor time zones need a name from the IANA database; abbreviations such as EST are ambiguous.
Fix: Use a name such as "America/Toronto", or leave timezone off for UTC.
DUPLICATE_TASK
Section titled “DUPLICATE_TASK”What you see: Two tasks share a name.
Why: A task’s name identifies its schedule on the host and in discord0 task <name>.
Fix: Rename one task. Tasks in sub-apps share the main app’s namespace.
UNKNOWN_TASK
Section titled “UNKNOWN_TASK”What you see: A task was run by a name the app doesn’t define.
Why: runTask(), discord0 task, and host schedules look tasks up by name.
Fix: Check the spelling against the names listed in the message. After renaming a task, deploy again so the host’s schedule uses the new name.
NO_SCHEDULED_TASK
Section titled “NO_SCHEDULED_TASK”What you see: The host fired a schedule the deployed app has no task for.
Why: The host’s schedules come from the last deploy. A task removed or rescheduled in code still fires until you deploy again.
Fix: Run discord0 deploy so the host’s schedules match app.task() again.
TASKS_UNSUPPORTED
Section titled “TASKS_UNSUPPORTED”What you see: The adapter can’t run the app’s scheduled tasks as written.
Why: Each host has its own scheduler. Some can’t run tasks at all, some schedule in UTC only, and EventBridge can’t combine a day of the month with a day of the week.
Fix: Follow the fix in the message, or deploy with an adapter whose scheduler supports the task: aws, node, and bun honor time zones.
Webhooks and events
Section titled “Webhooks and events”INVALID_WEBHOOK
Section titled “INVALID_WEBHOOK”What you see: An app.webhook() route has an invalid path or options.
Why: Webhook paths are routed by the host as exact URLs, so they must be absolute, without a trailing slash, query, . or .. segments.
Fix: Use a path such as "/webhooks/github", HTTP methods such as ["POST"], and a positive maxBodyBytes.
WEBHOOK_NEEDS_VERIFY
Section titled “WEBHOOK_NEEDS_VERIFY”What you see: A webhook route has no verify option.
Why: A webhook URL is public, so anyone can post to it. verify is required so that skipping verification is a visible choice.
Fix: Pass verify: verifyHmac({ ... }) or your own check. Pass verify: false only for a source that can’t sign requests.
app.webhook( "/webhooks/github", { verify: verifyHmac({ secret: () => process.env.GITHUB_WEBHOOK_SECRET, header: "x-hub-signature-256", prefix: "sha256=", }), }, (c) => new Response(null, { status: 202 }),);PATH_CONFLICT
Section titled “PATH_CONFLICT”What you see: A webhook or events path collides with another route or a path the host reserves.
Why: Each URL can reach one route. /interactions takes only Discord’s signed interactions, /events takes app.event() webhook events, and some hosts reserve paths such as /api (Vercel) and /.netlify (Netlify).
Fix: Choose another path, such as /webhooks/<service>, or move the events endpoint with new Discord({ eventsPath }).
MISSING_HANDLER
Section titled “MISSING_HANDLER”What you see: app.event() or app.webhook() was called without a handler function.
Why: Each route needs a function to run when it’s called.
Fix: Pass the handler as the last argument.
INVALID_EVENT_TYPE
Section titled “INVALID_EVENT_TYPE”What you see: app.event() got an event type that isn’t Discord’s name for one.
Why: Discord names webhook events in SCREAMING_SNAKE_CASE, and discord0 enables exactly these names in the Developer Portal instructions.
Fix: Use Discord’s name, such as "APPLICATION_AUTHORIZED" or "ENTITLEMENT_CREATE".
INVALID_EVENT_BODY
Section titled “INVALID_EVENT_BODY”What you see: app.dispatchEvent() got a body that isn’t a Discord webhook event.
Why: dispatchEvent() expects the parsed JSON Discord posts to the events URL: { version, application_id, type, event }.
Fix: Pass the whole event body. In tests, build one with discord0/testing.
INVALID_WEBHOOK_URL
Section titled “INVALID_WEBHOOK_URL”What you see: A Discord webhook to post to isn’t a webhook URL.
Why: Posting through a webhook needs its ID and token, which discord0 reads from the URL.
Fix: Pass the URL Discord shows under Integrations → Webhooks, https://discord.com/api/webhooks/<id>/<token>, or { id, token }.
Credentials and REST
Section titled “Credentials and REST”MISSING_PUBLIC_KEY
Section titled “MISSING_PUBLIC_KEY”What you see: The app received a request before it had a public key.
Why: Discord signs every interaction with your application’s Ed25519 key, and discord0 must check the signature before trusting the request.
Fix: Set DISCORD_PUBLIC_KEY (Developer Portal → General Information → Public Key) in .env and in the host’s environment, or pass publicKey to new Discord().
INVALID_PUBLIC_KEY
Section titled “INVALID_PUBLIC_KEY”What you see: The public key isn’t a 64-character hex string.
Why: An Ed25519 public key is 32 bytes, which the Developer Portal shows as 64 hex characters.
Fix: Copy the Public Key from Developer Portal → General Information again; don’t use the bot token or client secret.
MISSING_BOT_TOKEN
Section titled “MISSING_BOT_TOKEN”What you see: A command sync ran without a bot token.
Why: Registering commands is a REST call that Discord authorizes with the bot token.
Fix: Set DISCORD_BOT_TOKEN (Developer Portal → Bot → Reset Token) in .env, or skip syncing with --no-sync.
APPLICATION_NOT_FOUND
Section titled “APPLICATION_NOT_FOUND”What you see: discord0 couldn’t look up which application the bot token belongs to.
Why: Command sync needs the application ID. Without APPLICATION_ID, discord0 asks Discord for it with the token, which failed.
Fix: Set APPLICATION_ID (Developer Portal → General Information → Application ID), and check that DISCORD_BOT_TOKEN is current.
INVALID_REST_REQUEST
Section titled “INVALID_REST_REQUEST”What you see: A REST request targeted a URL outside Discord’s API.
Why: The REST client attaches the bot token to requests, so it refuses any URL other than https://discord.com/api/v10.
Fix: Call Discord’s API through c.rest or the paths in discord0/openapi. Use fetch for other services.
INVALID_REST_OPTION
Section titled “INVALID_REST_OPTION”What you see: A REST, rate limit, or request limit option is out of range.
Why: These limits must be positive, finite numbers for requests to be checked and scheduled.
Fix: Correct the option named in the message, or leave it unset for the default.
DISCORD_API_ERROR
Section titled “DISCORD_API_ERROR”What you see: Discord’s API rejected a request.
Why: Discord returned an HTTP error. The error’s status, code, and errors say which; the message adds a likely fix for common codes.
Fix: Read the hint in the message. 401: reset the bot token. 403 or 50001: invite the bot with the bot and applications.commands scopes. 50035: fix the fields listed in the message. 10062: answer within 3 seconds or let discord0 defer.
Deploy and CLI
Section titled “Deploy and CLI”INVALID_CONFIG
Section titled “INVALID_CONFIG”What you see: discord0.config.ts has an invalid setting.
Why: The CLI validates the config before building, so a typo fails fast instead of deploying with the wrong settings.
Fix: Correct the setting named in the message. Valid options are entry, adapter, guild, and sync.
import adapter from "@discord0/adapter-cloudflare";import { defineConfig } from "discord0";
export default defineConfig({ adapter: adapter(), guild: process.env.DISCORD_GUILD_ID,});GUILD_REQUIRED
Section titled “GUILD_REQUIRED”What you see: A guild sync was requested without a server ID.
Why: Syncing to one server, which updates instantly, needs that server’s ID.
Fix: Pass --guild <id>, set DISCORD_GUILD_ID in .env, or set guild in discord0.config.ts. Copy the ID with Developer Mode on: right-click the server → Copy Server ID.
ADAPTER_REQUIRED
Section titled “ADAPTER_REQUIRED”What you see: discord0 deploy doesn’t know which host to deploy to.
Why: Each host needs its own bundle and provider CLI.
Fix: Pass the adapter, discord0 deploy cloudflare, or set adapter in discord0.config.ts.
ADAPTER_NOT_FOUND
Section titled “ADAPTER_NOT_FOUND”What you see: The adapter package isn’t installed.
Why: discord0 deploy <name> loads @discord0/adapter-<name> from the project’s dependencies.
Fix: Install the package with the command in the message.
INVALID_ADAPTER
Section titled “INVALID_ADAPTER”What you see: The configured adapter isn’t a discord0 adapter.
Why: adapter in discord0.config.ts must be the object an adapter package’s default export returns.
Fix: Call the adapter: adapter: cloudflare(), not adapter: cloudflare.
INVALID_ENTRY
Section titled “INVALID_ENTRY”What you see: The entry point is missing, or doesn’t export default a Discord app.
Why: The CLI imports the entry point to read its commands, tasks, and webhooks, and the host calls its fetch.
Fix: Point entry (default src/index.ts) at the file that ends with export default app, where app = new Discord().
APP_LOAD_FAILED
Section titled “APP_LOAD_FAILED”What you see: The entry point threw while the CLI loaded it.
Why: Before building, the CLI runs the entry point to read its tasks, webhooks, and events, so top-level code runs then too.
Fix: Read the app’s output in the message. Move work that needs the host’s environment, such as database connections, into handlers.
BUILD_FAILED
Section titled “BUILD_FAILED”What you see: Bundling the app for the host failed.
Why: Each host runs one JavaScript file, so the app and its imports must bundle without assets.
Fix: Fix the build errors in the message. Import data as JSON or TypeScript instead of other asset types, and keep the entry point outside .discord0.
UNSUPPORTED_RUNTIME
Section titled “UNSUPPORTED_RUNTIME”What you see: An adapter’s handler ran outside the runtime it was built for.
Why: Each adapter wraps the app for one host’s runtime and relies on its APIs, such as Lambda’s response streaming.
Fix: Deploy the bundle with discord0 deploy <adapter> to the matching host, or import the adapter that matches where the code runs.
ADAPTER_FAILED
Section titled “ADAPTER_FAILED”What you see: An adapter produced files discord0 refuses to write.
Why: Adapters may write only inside .discord0/<adapter>, so a buggy adapter can’t overwrite the project.
Fix: This is a bug in the adapter. Report it with the path from the message.
INIT_FAILED
Section titled “INIT_FAILED”What you see: discord0 init can’t create a project in the directory.
Why: init never overwrites files, so it needs a new or empty directory.
Fix: Pass a new directory, discord0 init my-bot, or empty the existing one.
Testing
Section titled “Testing”INVALID_TEST_INPUT
Section titled “INVALID_TEST_INPUT”What you see: A discord0/testing helper got a command, option, or app the app doesn’t define.
Why: The test client builds interactions from the app’s own command definitions, the way Discord would, so it rejects names Discord would never send.
Fix: Use the full path, such as client.command("ticket open", { title: "Help" }), and only option names the command defines.
Runtime logs
Section titled “Runtime logs”HANDLER_FAILED
Section titled “HANDLER_FAILED”What you see: An interaction, event, task, or webhook handler threw.
Why: discord0 catches the error so the request still gets an answer: users see the generic messages.error reply, webhooks get a 500, and events and tasks are logged.
Fix: Read the error and stack trace below the message. Report errors elsewhere with app.onError().
BACKGROUND_WORK_FAILED
Section titled “BACKGROUND_WORK_FAILED”What you see: Work passed to waitUntil rejected after the response was sent.
Why: The response already went out, so the failure can only be logged.
Fix: Read the error below the message, and catch errors inside the background work if it needs its own handling.
WEBHOOK_VERIFY_FAILED
Section titled “WEBHOOK_VERIFY_FAILED”What you see: A webhook’s verify function threw, so the request was rejected with 401.
Why: A verifier that throws can’t vouch for the request, so discord0 treats it as unverified.
Fix: Return false (or a Response) for bad requests instead of throwing, and check the secret and header names.
WEBHOOK_SECRET_UNSET
Section titled “WEBHOOK_SECRET_UNSET”What you see: verifyHmac() has no secret, so the webhook answered 503.
Why: Without the shared secret no request can be verified, so every request is refused until it’s set.
Fix: Set the secret’s environment variable on the host, then redeploy if the host needs it.