@sern/handler
Namespaces
Enumerations
Classes
- CommandExecutable
- Context
- DefaultErrorHandling
- DefaultLogging
- DefaultModuleManager
- EventExecutable
- ModuleStore
- SernEmitter
Interfaces
- AutocompleteCommand
- AutocompletePlugin
- BothCommand
- ButtonCommand
- ChannelSelectCommand
- CommandPlugin
- ContextMenuMsg
- ContextMenuUser
- Controller
- Dependencies
- DiscordEmitterPlugin
- DiscordEventPlugin
- ErrorHandling
- EventPlugin
- ExternalEmitterPlugin
- ExternalEventPlugin
- Logging
- MentionableSelectCommand
- ModalSubmitCommand
- Module
- ModuleManager
- Plugin
- RoleSelectCommand
- SernAutocompleteData
- SernEmitterPlugin
- SernEventPlugin
- SernSubCommandData
- SernSubCommandGroupData
- SlashCommand
- StringSelectCommand
- TextCommand
- UserSelectCommand
- Wrapper
Type Aliases
AnyDefinedModule
Ƭ AnyDefinedModule: DefinedCommandModule | DefinedEventModule
Defined in
AnyModule
Ƭ AnyModule: CommandModule | EventModule
Defined in
Args
Ƭ Args: ParseType<{ slash: SlashOptions ; text: string[] }>
Defined in
BaseOptions
Ƭ BaseOptions: ApplicationCommandChoicesData | ApplicationCommandNonOptionsData | ApplicationCommandChannelOptionData | ApplicationCommandNumericOptionData | ApplicationCommandAttachmentOption | SernAutocompleteData
Type that replaces autocomplete with SernAutocompleteData
Defined in
CommandModule
Ƭ CommandModule: TextCommand | SlashCommand | BothCommand | ContextMenuUser | ContextMenuMsg | ButtonCommand | StringSelectCommand | MentionableSelectCommand | UserSelectCommand | ChannelSelectCommand | RoleSelectCommand | ModalSubmitCommand
Defined in
CommandModuleDefs
Ƭ CommandModuleDefs: Object
Type declaration
Defined in
CommandModuleNoPlugins
Ƭ CommandModuleNoPlugins: { [T in CommandType]: Omit<CommandModuleDefs[T], "plugins" | "onEvent"> }
Defined in
src/handler/plugins/plugin.ts:108
CommandModulePlugin
Ƭ CommandModulePlugin<T>: EventPlugin<T> | CommandPlugin<T>
Type parameters
| Name | Type |
|---|---|
T | extends CommandType |
Defined in
src/handler/plugins/plugin.ts:136
DefinedCommandModule
Ƭ DefinedCommandModule: CommandModule & { description: string ; name: string }
After modules are transformed, name and description are given default values if none are provided to Module. This type represents that transformation
Defined in
DefinedEventModule
Ƭ DefinedEventModule: EventModule & { name: string }
Defined in
EventModule
Ƭ EventModule: DiscordEventCommand | SernEventCommand | ExternalEventCommand
Defined in
EventModuleCommandPluginDefs
Ƭ EventModuleCommandPluginDefs: Object
Event Module Command Plugins
Type declaration
| Name | Type |
|---|---|
1 | DiscordEmitterPlugin |
2 | SernEmitterPlugin |
3 | ExternalEmitterPlugin |
Defined in
src/handler/plugins/plugin.ts:126
EventModuleDefs
Ƭ EventModuleDefs: Object
Type declaration
| Name | Type |
|---|---|
1 | DiscordEventCommand |
2 | SernEventCommand |
3 | ExternalEventCommand |
Defined in
EventModuleEventPluginDefs
Ƭ EventModuleEventPluginDefs: Object
Event Module Event Plugins
Type declaration
| Name | Type |
|---|---|
1 | DiscordEventPlugin |
2 | SernEventPlugin |
3 | ExternalEventPlugin |
Defined in
src/handler/plugins/plugin.ts:117
EventModulePlugin
Ƭ EventModulePlugin<T>: EventModuleEventPluginDefs[T] | EventModuleCommandPluginDefs[T]
Type parameters
| Name | Type |
|---|---|
T | extends EventType |
Defined in
src/handler/plugins/plugin.ts:132
EventModulesNoPlugins
Ƭ EventModulesNoPlugins: { [T in EventType]: Omit<EventModuleDefs[T], "plugins" | "onEvent"> }
Defined in
src/handler/plugins/plugin.ts:111
InputCommandModule
Ƭ InputCommandModule: { [T in CommandType]: CommandModuleNoPlugins[T] & Object }[CommandType]
User inputs this type. Sern processes behind the scenes for better usage
Defined in
src/handler/plugins/plugin.ts:141
InputEventModule
Ƭ InputEventModule: { [T in EventType]: EventModulesNoPlugins[T] & Object }[EventType]
Defined in
src/handler/plugins/plugin.ts:145
LogPayload
Ƭ LogPayload<T>: Object
Type parameters
| Name | Type |
|---|---|
T | unknown |
Type declaration
| Name | Type |
|---|---|
message | T |
Defined in
MapDeps
Ƭ MapDeps<Deps, T>: T extends [infer First, ...(infer Rest extends readonly unknown[])] ? [UnpackFunction<Deps[First]>, ...(MapDeps<Deps, Rest> extends [never] ? [] : MapDeps<Deps, Rest>)] : [never]
Type parameters
| Name | Type |
|---|---|
Deps | extends Dependencies |
T | extends readonly unknown[] |
Defined in
OptionalDependencies
Ƭ OptionalDependencies: "@sern/logger"
Defined in
ParseType
Ƭ ParseType<T>: { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof T]
Type parameters
| Name |
|---|
T |
Defined in
Payload
Ƭ Payload: { module: AnyModule ; type: Success } | { module?: AnyModule ; reason: string | Error ; type: Failure } | { reason: string ; type: Warning }
Defined in
ReplyOptions
Ƭ ReplyOptions: string | Omit<InteractionReplyOptions, "fetchReply"> | MessageReplyOptions
Defined in
SernEventsMapping
Ƭ SernEventsMapping: Object
Type declaration
| Name | Type |
|---|---|
error | [Payload] |
module.activate | [Payload] |
module.register | [Payload] |
warning | [Payload] |
Defined in
SernOptionsData
Ƭ SernOptionsData<U>: U extends ApplicationCommandSubCommandData ? SernSubCommandData : U extends ApplicationCommandSubGroupData ? SernSubCommandGroupData : BaseOptions
Type parameters
| Name | Type |
|---|---|
U | extends ApplicationCommandOptionData = ApplicationCommandOptionData |
Defined in
Singleton
Ƭ Singleton<T>: () => T
Type parameters
| Name |
|---|
T |
Type declaration
▸ (): T
Returns
T
Defined in
SlashOptions
Ƭ SlashOptions: Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">
Defined in
Transient
Ƭ Transient<T>: () => () => T
Type parameters
| Name |
|---|
T |
Type declaration
▸ (): () => T
Returns
fn
▸ (): T
Returns
T
Defined in
Functions
commandModule
▸ commandModule(mod): CommandModule
The wrapper function to define command modules for sern
Parameters
| Name | Type |
|---|---|
mod | InputCommandModule |
Returns
Defined in
eventModule
▸ eventModule(mod): EventModule
The wrapper function to define event modules for sern
Parameters
| Name | Type |
|---|---|
mod | InputEventModule |
Returns
Defined in
many
▸ many<T>(value): () => () => T
A function that returns another function Used for transient in iti
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | T |
Returns
fn
▸ (): () => T
Returns
fn
▸ (): T
Returns
T
Defined in
src/handler/utilities/functions.ts:16
single
▸ single<T>(value): () => T
A function that returns whatever value is provided. Used for singleton in iti
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | T |
Returns
fn
▸ (): T
Returns
T
Defined in
src/handler/utilities/functions.ts:10
useContainerRaw
▸ useContainerRaw(): null | Container<Dependencies, Partial<Dependencies>>
Returns the underlying data structure holding all dependencies. Exposes some methods from iti
Returns
null | Container<Dependencies, Partial<Dependencies>>