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

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

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.2.50/client/1_composer.ts";

Constructors

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

Type Parameters

C extends { me?: User; }

Properties

writeonly
prefixes: string | string[]

Methods

branch(
predicate: (ctx: C & UpdateIntersection) => MaybePromise<boolean>,
trueHandler_: Middleware<C & UpdateIntersection>,
falseHandler_: Middleware<C & UpdateIntersection>,
): Composer<C>
callbackQuery(data: string | RegExp | (string | RegExp)[], ...middleware: Middleware<WithFilter<C, "callbackQuery:data">>[]): Composer<WithFilter<C, "callbackQuery:data">>
command(commands:
| string
| RegExp
| (string | RegExp)[]
| { names: string | RegExp | (string | RegExp)[]; prefixes: string | string[]; }
, ...middleware: Middleware<WithFilter<C, "message:text">>[]
): Composer<WithFilter<C, "message:text">>
filter<D extends C>(predicate: (ctx: C & UpdateIntersection) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>
filter(predicate: (ctx: C & UpdateIntersection) => MaybePromise<boolean>, ...middleware: Middleware<C & UpdateIntersection>[]): Composer<C>
inlineQuery(queries: string | RegExp | (string | RegExp)[], ...middleware: Middleware<WithFilter<C, "inlineQuery">>[]): Composer<WithFilter<C, "inlineQuery">>
on<Q extends FilterQuery>(filter: Q, ...middleware: Middleware<WithFilter<C, Q>>[]): Composer<WithFilter<C, Q> & UpdateIntersection>
use(...middleware: Middleware<C & UpdateIntersection>[]): Composer<C>