Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mtkruto/client/4_composer.ts>Composer

[WIP] Cross-runtime JavaScript library for building Telegram clients
Go to Latest
class Composer
implements MiddlewareObj<C>
import { Composer } from "https://deno.land/x/mtkruto@0.1.118/client/4_composer.ts";

Constructors

new
Composer(...middleware: Middleware<C>[])

Type Parameters

C extends Update

Methods

branch(
predicate: (ctx: C) => MaybePromise<boolean>,
trueHandler_: Middleware<C>,
falseHandler_: Middleware<C>,
)
command(commands: string | RegExp | (string | RegExp)[], ...middleawre: Middleware<FilterUpdate<C, "message", "text">>[])
filter<D extends C>(predicate: (ctx: C) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>
filter(predicate: (ctx: C) => MaybePromise<boolean>, ...middleware: Middleware<C>[]): Composer<C>
on<T extends keyof Update_, F extends string>(filter: T extends FilterableUpdates ? T | [T, F, ...F[]] : T, ...middleawre: Middleware<FilterUpdate<C, T, F>>[])
use(...middleware: Middleware<C>[])