API reference
The Zephyr host API
Modules run as sandboxed Lua and reach the outside world only through the global zephyr table. Each function below lists the capabilities it needs — a module is granted only the permissions it declares in its manifest.
100 functions · 18 namespaces
Core
zephyr2Top-level helpers available directly on the global `zephyr` table.
zephyr.package2Metadata and file loaders for the current module. Also exposes the value fields `id`, `name`, `version`, and `settings` (manifest settings merged with `.runtime-config.json` overrides; all values are strings).
zephyr.modules2Query the set of modules installed alongside this one in the current runtime.
zephyr.commands2Register slash command and autocomplete handlers at module load time.
zephyr.locale4Look up translations from the module and framework catalogs, honoring the configured preferred and fallback languages.
zephyr.bus4Send JSON-like messages between installed modules. Bus operations are not permission-gated.
zephyr.time3Time and duration helpers.
zephyr.timers1Schedule deferred messages back to the current module. Timers are in-memory and do not survive process restarts. Requires the `timers` permission.
zephyr.util7Encoding and JSON helpers. No permissions required.
Storage
Discord
Files & network
zephyr.io7Sandboxed file storage. Paths are virtual, rooted at the module's persistent data directory (`ZEPHYR_DATA_DIR/modules/<module_id>`); absolute-looking paths are still scoped there and parent traversal is rejected. Reads and writes use raw Lua-string bytes. All functions require the `io` permission.
zephyr.net4Outbound network access. `tcp_connect` requires `net:tcp`; `http` requires `net:http`; `download` requires both `net:http` and `io`.
Voice
zephyr.songbird7In-process voice playback. Plays files from the module's `zephyr.io` sandbox. Requires the `songbird` permission; declare `services = ["songbird"]` for production. Only one backend (Songbird or Lavalink) may own a guild voice session at a time.
zephyr.lavalink12Playback through a shared Lavalink v4 node. Requires the `lavalink` permission; declare `services = ["lavalink"]` for production. Track and player return values are the Lavalink v4 JSON shapes (camelCase fields like `loadType`, `encoded`, `info`, `state`).