Core Components
API Reference for exported components
This package exports the following key components via its main index.js.
Classes
Kythia
The main orchestrator class. It initializes all managers, manages the startup sequence, and holds the central dependency container.
- Usage: Instantiated in your main bot's
index.js(new Kythia(dependencies)). - Startup:
kythiaInstance.start()initiates the entire bot lifecycle.
KythiaClient
An extended discord.js Client class. It's pre-configured with recommended intents, partials, and cache settings for a typical large bot.
- Key Feature: The
containeris attached directly to the client instance (client.container).
KythiaModel
The base class for ALL Sequelize models used within the Kythia framework (both core and addons).
- Hybrid Caching: Automatically caches queries in Redis, falling back to in-memory Map.
- Cache Methods:
getCache,getAllCache,findOrCreateWithCache, etc. - Automatic Invalidation: Hooks into save/destroy to clear relevant cache tags.
KythiaORM
An intelligent database synchronization utility.
- Safety: Checks for destructive changes before running.
- Efficiency: Only runs
alter: trueon models that have actually changed (via hash comparison). - Discovery: Automatically loads addon models.
ContainerBuilder
The primary utility for creating beautiful Discord embeds. It provides a fluent API for building complex, interactive messages.
- Components: Add text displays, buttons, select menus, and media galleries.
- Aesthetics: Automatically handles accent colors, separators, and consistent formatting.
Utilities
createSequelizeInstance
A factory function that creates and configures the main Sequelize instance based on your bot's configuration.
helpers
The container provides access to a set of core helpers via container.helpers.
helpers.color: Advanced color conversion and manipulation.helpers.time: Human-readable duration and timestamp formatting.helpers.pagination: Easy-to-use button-based pagination for large data sets.