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.1.141/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: UpdateIntersection<C>) => MaybePromise<boolean>,
falseHandler_: Middleware<UpdateIntersection<C>>,
)
command(commands:
| string
| RegExp
| (string | RegExp)[]
| { names: string | RegExp | (string | RegExp)[]; prefixes: string | string[]; }
, ...middleawre: Middleware<WithFilter<C, "message:text">>[]
)
filter<D extends C>(predicate: (ctx: UpdateIntersection<C>) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>
filter(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, ...middleware: Middleware<UpdateIntersection<C>>[]): Composer<C>
on<Q extends FilterQuery>(filter: Q, ...middleawre: Middleware<WithFilter<C, Q>>[])
use(...middleware: Middleware<UpdateIntersection<C>>[])