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 Parameter | Default type |
|---|---|
In | any |
Out extends In | In |
Parameters
| Parameter | Type |
|---|---|
context | In |
Returns
context is Out