type CreateBightAppOptions,
Creates a Bight application instance. Returns a BightApp with start() and createRuntime() methods.
| Property | Type | Required | Description |
|---|
loadRegistry | () => BightRegistry | Yes | Returns the command, handler, and precondition registry (typically via createFilesystemDiscovery) |
createServices | (client: Client) => TServices | Yes* | Factory for your app services. Mutually exclusive with createContext. |
createLogger | (client: Client) => BightLogger | No | Custom logger factory. Defaults to the built-in logger. |
createContext | (client: Client) => BightContext<TServices> | No | Advanced escape hatch — builds the full context manually. Cannot be used with createServices or createLogger. |
clientOptions | ClientOptions | No | Discord.js client options (intents, etc). Ignored if createClient is provided. |
createClient | () => Client | No | Custom client factory. Overrides clientOptions. |
loadFeatures | () => BightFeature[] | No | Feature modules to merge into the registry. |
loadEvents | () => BotEvent[] | No | Discord client event listeners. |
loadPlugins | () => MaybeBightPlugin[] | No | Plugins to apply during initialization. |
runtime | Object | No | Runtime policies (see below). |
loginMessage | string | No | Custom log message on login. Defaults to "Logging in to Discord." |
| Property | Type | Description |
|---|
cooldowns | CooldownOptions | Global cooldown configuration |
environment | BightRuntimeEnvironment | Runtime environment settings (e.g, devOnly enforcement) |
globalPreconditions | string[] | Names of preconditions to evaluate on every interaction |
onDenied | BightDeniedHandler | Global fallback handler for precondition denials |
Returned by createRuntime(). Contains all resolved runtime state.
| Property | Type | Description |
|---|
client | Client | The Discord.js client instance |
registry | BightRegistry | Resolved command and handler registry |
context | BightContext | The context object passed to all handlers |
events | BotEvent[] | All registered event listeners |
plugins | AppliedPlugins | Applied plugin state with lifecycle hooks |
diagnostics | BightDiagnosticsHub | The diagnostics hub |
start | (token: string) => Promise<void> | Connects to Discord |
The context object passed into every command, interaction handler, and plugin hook.
| Property | Type | Description |
|---|
client | Client | The Discord.js client |
logger | BightLogger | The app logger |
services | TServices | Your app-owned services |