Skip to content

export abstract Class

Event ​

extends ​

Piece<EventMeta>

An event piece.

Constructor ​

ts
 new Event( context_piece, context_metadata )
ParameterTypeDescription
context_piecePieceContext
context_metadataEventMeta

Properties ​

get enabled : boolean ​

readonly client : Client ​

emitter : any ​

event : string ​

name : ClientEvent ​

once : boolean ​

registry : EventsRegistry ​

Methods ​

disable( ) ​

Stops and disables the piece.

Returns: void

enable( resume ) ​

ParameterTypeDescription
resume?booleanWether to resume the piece, must be enabled.

Enables the piece.

Returns: void

listen( ) ​

Activates or resumes the listener, this is activated on load.

Returns: void

run( ...args ) ​

ParameterTypeDescription
...argsunknown[]

Returns: unknown

stop( ) ​

Stops the listener.

Returns: void

A modern, powerful library for building your Telegram bots, with seamless support for both JavaScript and Typescript.