Builtins
Built-in modules and primitives available to AntiRaid templates and internal services.
Updated April 11, 2026
Builtins are the built-in functionality that AntiRaid exposes to the system — replacing what used to be hardcoded bot commands. Instead of adding a new slash command every time someone needs new functionality, that functionality is implemented as a builtin that templates can call directly.
What builtins provide
- Common types —
User,GuildMember,Channel,Role, and other Discord entity types used across all services - Utility helpers — string manipulation, date/time formatting, permission calculations, and other shared functions
- Template APIs — the plugin interfaces that Luau templates access via
ctxandrequire
How they're used
Builtins are available by default inside the template worker. Templates access them via the @antiraid/* require namespace:
local discord = require "@antiraid/discord"
local kv = require "@antiraid/kv"
local interop = require "@antiraid/interop"Internal services (bot, api, jobserver) also consume builtins directly via Rust/Go imports — they're not Luau-only.
Extending builtins
To add a new builtin:
- Implement the type or function in the builtins crate
- Register it with the template worker's plugin registry
- Add Luau-facing bindings if it needs to be accessible from templates
- Document it in the API Reference
For the full list of available template APIs, see the Templating API Reference.