Skip to content

GramIO API Reference / gramio/dist / Handler

Type Alias: Handler()<T>

Handler<T> = (context, next) => unknown

Defined in: gramio/index.d.ts:600

Handler is a function with context and next function arguments

Type Parameters

Type Parameter
T

Parameters

ParameterType
contextT
nextNext

Returns

unknown

Example

ts
const handler: Handler<ContextType<Bot, "message">> = (context, _next) => context.send("HI!");

bot.on("message", handler)