Modules
Overview
Glyria modules are NPM packages that ship their own commands and events. Once declared in your config, they are automatically loaded alongside your own code — no manual imports needed.
Adding a module
Install the package, then declare it in glyria.config.ts:
npm install @glyria/timers
// glyria.config.ts
export default defineGlyriaConfig({
modules: ["@glyria/timers"]
})
That's it. Glyria will automatically discover and load the module's commands and events at startup.
How it works
When Glyria starts, it scans each declared module's package for commands/ and events/ folders and loads them exactly like your own files. If neither folder exists, it skips silently.
Auto imports
Each module exposes its exports under a PascalCase namespace derived from its package name. You can use them anywhere in your project without importing anything.
| Package | Namespace |
|---|---|
@glyria/timers | Timers.* |
@glyria/economy | Economy.* |
@glyria/moderation | Moderation.* |
// No import needed
const job = Timers.createJob(() => {
console.log("runs every minute")
}, "* * * * *")
@glyria/timers → Timers, @glyria/some-feature → SomeFeature.Multiple modules
export default defineGlyriaConfig({
modules: [
"@glyria/timers",
"@glyria/economy",
"@glyria/moderation",
]
})
Each module is independent — commands and events from all declared modules are loaded without conflict.

