Skip to main content

Namespace: Sern

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

NameType
next() => OkImpl<void>
stop() => ErrImpl<void>

Defined in

src/handler/sern.ts:82

Functions

addExternal

addExternal<T>(emitter): void

Deprecated

  • use Sern#makeDependencies instead

Example

src/index.ts
//Add this before initiating Sern!
Sern.addExternal(new Level())

Example

events/level.ts
 export default eventModule({
emitter: 'Level',
type : EventType.External,
name: 'error',
execute(args) {
console.log(args)
}
})

Type parameters

NameType
Textends __module

Parameters

NameTypeDescription
emitterTAny 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

src/handler/sern.ts:72


init

init(wrapper): void

Example

src/index.ts
Sern.init({
client,
defaultPrefix: '!',
commands: 'dist/commands',
})

Parameters

NameTypeDescription
wrapperWrapperOptions to pass into sern. Function to start the handler up

Returns

void

Defined in

src/handler/sern.ts:39