Your Discord bot token. Keep this in .env — never commit it.
OptionalmodeConnection mode.
"websocket" (default) — standard Gateway connection."http" — HTTP interactions endpoint for serverless deployments. Requires publicKey and port.OptionalpublicRequired when mode is "http". Your application's public key from the Discord Developer Portal.
OptionalportPort for the HTTP interactions server when mode is "http". Defaults to 3000.
OptionalprefixEnables legacy text commands. Provide a string prefix (e.g. "!") or a function
that returns the prefix(es) per message.
OptionalintentsOverride the auto-detected Gateway intents. Popii infers intents from your event filenames by default.
OptionalredisRedis connection URL (e.g. "redis://localhost:6379"). Enables Redis-backed storage and sharding coordination.
OptionalredisAlternative to redisUrl. Pass a connection string or an ioredis options object.
OptionalstorageProvide a custom storage adapter to replace the built-in in-process Map with any backend.
OptionalpartialsOverride the auto-detected Discord.js Partials. Popii infers partials from your event filenames by default.
OptionaldevA guild ID used to register slash commands during development. Guild commands sync instantly; global commands can take up to an hour. Remove or leave empty in production.
OptionalonCalled when a command or snap throws an error that is not caught by a middleware.
OptionalonCalled for unhandled promise rejections and uncaught exceptions not tied to a command.
OptionalownersDiscord user IDs that have bot-owner privileges (e.g. ownerOnly: true commands).
OptionalstateInitial value for pop.state and client.state. Persisted to Redis/storage between restarts.
OptionalcommandsOptionaldir?: stringOptionalfolderRouting?: booleanAutomatically maps nested folders into subcommands and subcommand groups.
e.g. src/commands/config/set.ts becomes /config set.
OptionalautoSync?: booleanAutomatically sync Slash Commands to Discord on startup.
Disable this in production to prevent rate-limits, and use popii sync instead.
OptionalhelpConfigure or disable the built-in /help command.
Set to false to disable it entirely, or an object to customise the command name and aliases.
OptionalstatusBot status/activity string. Pass an array to rotate between multiple statuses.
Supports template tokens: {{guilds}}, {{users}}, {{shardId}}.
OptionalstatusInterval in ms between status rotations when status is an array. Defaults to 30000.
OptionalpluginsPlugins to load. Plugins run in list order (highest priority first within that order).
OptionalautoWhen true, Popii scans node_modules for installed popii-plugin-* packages
(identified by a "popii" field in their package.json) and loads them automatically.
Explicitly registered plugins in plugins always take precedence.
OptionalpluginOptionaleventsOverride the directory Popii scans for event files. Defaults to "./src/events".
OptionalsnapsOverride the directory Popii scans for snap files. Defaults to "./src/snaps".
OptionalmiddlewaresOverride the directory Popii scans for middleware files. Defaults to "./src/middlewares".
OptionaltasksOverride the directory Popii scans for task files. Defaults to "./src/tasks".
OptionallocalesLocalization configuration.
dir — directory containing <locale>.json files. Defaults to "./src/locales".default — fallback locale code. Defaults to "en-US".url — remote URL to fetch locale files from (fetched at startup).OptionalloggerCustom logger implementation. Defaults to the built-in Popii logger.
OptionalfileWrite logs to rotating files in ./logs/. Defaults to false.
OptionalstructuredEmit log lines as newline-delimited JSON instead of human-readable text.
OptionalpresenceControls how rotating status messages are coordinated across shards.
'local' (default): each shard rotates independently.'coordinated': shard 0 leads rotation and broadcasts the active status
to all other shards via Redis pub/sub or IPC so they all show the same string.
Supports template tokens: {{shardId}}, {{guilds}}, {{users}}.OptionalstateTTL in milliseconds for persisted bot state in Redis/storage. Defaults to 90 days.
Optionalserver
Configuration passed to popiiClient when creating the bot.
Only
tokenis required. Everything else has sensible defaults.Example: Minimal setup
Example: Full setup with common options