API Reference

defineGlyriaConfig

Configure your glyria.js bot globally.

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.

OptionTypeDefaultDescription
restartPathsstring[]['composables', 'utils', 'services']Folders that trigger a full bot restart when changed
autoImportDirsstring[]['utils', 'composables']Folders scanned for auto-imported globals

By default, Glyria watches your src/ folder and applies the following behavior:

FolderBehavior
commands/Hot reload — commands are re-registered instantly, no restart
events/Hot reload — listeners are removed and re-added instantly
restartPaths foldersFull restart — bot process is cleanly killed and restarted
Everything elseIgnored
Files in folders like utils/ or services/ are loaded once at boot and can't be hot reloaded safely in ESM. A clean restart is the safest option.
If a command imports a file from 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']
  }
})
Exports from src/index.ts are always scanned automatically — no configuration needed.

theme.embedV2

Global theme applied automatically to all embeds built with EmbedV2Builder and createReplyableContext.

OptionTypeDefaultDescription
primaryColorHexColorString#5865F2Color for .g.reply.primary()
secondaryColorHexColorString#4F545CColor for .g.reply.secondary()
successColorHexColorString#57F287Color for .g.reply.success()
errorColorHexColorString#ED4245Color for .g.reply.error()
infoColorHexColorString#5DADE2Color for .g.reply.info()
warningColorHexColorString#FEE75CColor for .g.reply.warning()
footer.textstringFooter 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

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"
      }
    }
  }
})
Copyright © 2026