Skip to content

GramIO API Reference / gramio/dist / Filter

Type Alias: Filter()<In, Out>

Filter<In, Out> = (context) => context is Out

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

A type guard predicate that narrows In to Out. Built-in filters use any as In so they work with any bot's context type. The actual narrowing happens via intersection in the .on() handler type.

Type Parameters

Type ParameterDefault type
Inany
Out extends InIn

Parameters

ParameterType
contextIn

Returns

context is Out