Wrapper
Wrapper
Description
Configuration interface for the sern framework. This interface defines the structure for configuring essential framework features including command handling, event management, and task scheduling.
Properties
commands
commands:
string
|string
[]
Description
Specifies the directory path where command modules are located. This is a required property that tells sern where to find and load command files. The path should be relative to the project root. If given an array, each directory is loaded in order they were declared. Order of modules in each directory is not guaranteed
Example
1commands: ["./dist/commands"]
Source
defaultPrefix?
optional
defaultPrefix:string
Description
Optional prefix for text commands. This prefix will be used to identify text commands in messages. If not specified, text commands CommandType.Text will be disabled.
Example
1defaultPrefix: "?"
Source
events?
optional
events:string
|string
[]
Description
Optional directory path where event modules are located. If provided, Sern will automatically register and handle events from modules in this directory. The path should be relative to the project root. If given an array, each directory is loaded in order they were declared. Order of modules in each directory is not guaranteed.
Example
1events: ["./dist/events"]
Source
handleModuleErrors?
optional
handleModuleErrors:boolean
Description
Optional flag to enable automatic error handling for modules. When enabled, sern will automatically catch and handle errors that occur during module execution, preventing crashes and providing error logging.
Default
1false
Source
tasks?
optional
tasks:string
|string
[]
Description
Optional directory path where scheduled task modules are located. If provided, Sern will automatically register and handle scheduled tasks from modules in this directory. The path should be relative to the project root. If given an array, each directory is loaded in order they were declared. Order of modules in each directory is not guaranteed.
Example
1tasks: ["./dist/tasks"]