Skip to content

Core concepts

Popii 1.0 separates definition authoring from runtime execution. Definitions are validated before readiness, registries reject collisions and freeze, and resources use an explicit lifecycle:

created → validating → initializing → starting → ready → stopping → stopped

Startup failures roll back in reverse order. Executions receive a correlation ID, abort signal, timeout, middleware chain, safe errors, metrics, and outcome hooks.

Commands receive a pop context containing the Discord interaction or message, client, options, localization, logger, and plugin extensions.

Events react to Discord.js events. Middleware wraps commands and components for authorization, validation, analytics, or error behavior.

Snaps are persistent component handlers. Tasks are named background jobs with optional cron schedules, retries, overlap control, and timeouts.

See the generated API reference for exact public types.

Feature imports are available from /config, /commands, /events, /middleware, /components, /tasks, /plugins, and /testing. The compatibility popiiClient() façade remains available while createApplication() provides the new Discord-free lifecycle foundation.