defineGlyriaConfig
Overview
defineGlyriaConfig is a typed helper to define your bot's global configuration in glyria.config.ts at the root of your project.
// glyria.config.ts
export default defineGlyriaConfig({
dev: {
restartPaths: ['composables', 'utils', 'services'],
autoImportDirs: ['utils', 'composables']
},
theme: {
embedV2: {
primaryColor: "#5865F2",
successColor: "#57F287",
errorColor: "#ED4245",
footer: {
text: "My Bot • v1.0",
}
}
}
})
defineGlyriaConfig is available globally — no import needed.glyria.config.ts is hot reloaded in dev mode — no restart needed when you update your config.GlyriaConfig
dev
Configuration for the dev mode watcher and auto-imports.
| Option | Type | Default | Description |
|---|---|---|---|
restartPaths | string[] | ['composables', 'utils', 'services'] | Folders that trigger a full bot restart when changed |
autoImportDirs | string[] | ['utils', 'composables'] | Folders scanned for auto-imported globals |
By default, Glyria watches your src/ folder and applies the following behavior:
| Folder | Behavior |
|---|---|
commands/ | Hot reload — commands are re-registered instantly, no restart |
events/ | Hot reload — listeners are removed and re-added instantly |
restartPaths folders | Full restart — bot process is cleanly killed and restarted |
| Everything else | Ignored |
utils/ or services/ are loaded once at boot and can't be hot reloaded safely in ESM. A clean restart is the safest option.utils/, modifying that file will trigger a restart (if utils is in restartPaths) — but if it's not, the old module may still be cached. Add the folder to restartPaths to ensure a clean reload.autoImportDirs
Folders listed in autoImportDirs are scanned at startup — every export const, export function, and export class found is injected into the global scope automatically.
Write folder names without src/ or dist/ prefix — Glyria resolves the correct path depending on the environment.
export default defineGlyriaConfig({
dev: {
autoImportDirs: ['utils', 'composables', 'helpers', 'lib']
}
})
src/index.ts are always scanned automatically — no configuration needed.theme.embedV2
Global theme applied automatically to all embeds built with EmbedV2Builder and createReplyableContext.
| Option | Type | Default | Description |
|---|---|---|---|
primaryColor | HexColorString | #5865F2 | Color for .g.reply.primary() |
secondaryColor | HexColorString | #4F545C | Color for .g.reply.secondary() |
successColor | HexColorString | #57F287 | Color for .g.reply.success() |
errorColor | HexColorString | #ED4245 | Color for .g.reply.error() |
infoColor | HexColorString | #5DADE2 | Color for .g.reply.info() |
warningColor | HexColorString | #FEE75C | Color for .g.reply.warning() |
footer.text | string | — | Footer text appended to every container |
Colors
Colors are defined as hex strings (HexColorString from discord.js):
primaryColor: "#5865F2" // ✅
primaryColor: 0x5865F2 // ❌ use hex string, not number
Footer
When footer.text is set, it is automatically appended to every ContainerBuilder when .end() is called — no extra code needed in your commands.
theme: {
embedV2: {
footer: {
text: "My Bot • v1.0"
}
}
}
Full example
// glyria.config.ts
export default defineGlyriaConfig({
dev: {
autoImportDirs: ['utils', 'composables', 'helpers'],
restartPaths: ['composables', 'utils', 'services']
},
theme: {
embedV2: {
primaryColor: "#7289DA",
secondaryColor: "#747F8D",
successColor: "#43B581",
errorColor: "#F04747",
warningColor: "#FAA61A",
infoColor: "#00B0F4",
footer: {
text: "My Bot • v1.0"
}
}
}
})

