mirror of
https://github.com/sern-handler/website
synced 2026-06-06 01:16:47 +00:00
2.4 KiB
2.4 KiB
id, title, sidebar_label, sidebar_position, custom_edit_url
| id | title | sidebar_label | sidebar_position | custom_edit_url |
|---|---|---|---|---|
| Sern | Namespace: Sern | Sern | 0 | null |
References
CommandExecutable
Re-exports CommandExecutable
EventExecutable
Re-exports EventExecutable
commandModule
Re-exports commandModule
eventModule
Re-exports eventModule
Variables
controller
• Const controller: Object
The object passed into every plugin to control a command's behavior
Type declaration
| Name | Type |
|---|---|
next |
() => OkImpl<void> |
stop |
() => ErrImpl<void> |
Defined in
Functions
addExternal
▸ addExternal<T>(emitter): void
Deprecated
- use Sern#makeDependencies instead
Example
//Add this before initiating Sern!
Sern.addExternal(new Level())
Example
export default eventModule({
emitter: 'Level',
type : EventType.External,
name: 'error',
execute(args) {
console.log(args)
}
})
Type parameters
| Name | Type |
|---|---|
T |
extends __module |
Parameters
| Name | Type | Description |
|---|---|---|
emitter |
T |
Any external event emitter. The object will be stored in a map, and then fetched by the name of the instance's class. As there are infinite possibilities to adding external event emitters, Most types aren't provided and are as narrow as possibly can. |
Returns
void
Defined in
init
▸ init(wrapper): void
Example
Sern.init({
client,
defaultPrefix: '!',
commands: 'dist/commands',
})
Parameters
| Name | Type | Description |
|---|---|---|
wrapper |
Wrapper |
Options to pass into sern. Function to start the handler up |
Returns
void