Optional ttlStatic mountRest ...fns: NonemptyReadonlyArray<Middleware<FilteredContext<Ctx, Filter>>>Rest use Composer.on instead
Generates middleware for handling provided update types.
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<Ctx, MountMap[Filter]>, MountMap[Filter]>>Rest use Composer.on instead
Registers middleware for handling matching callback queries.
Rest ...fns: MatchedMiddleware<C, "callback_query">Rest Registers middleware for handling specified commands.
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<{ Rest Rest ...fns: Middleware<C>[]Rest Registers middleware for handling game queries
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, CallbackQueryUpdate<GameQuery>>>>Rest Registers middleware for handling updates matching given type guard function.
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, U>, U>>Rest use Composer::on
Registers middleware for handling matching text messages.
Rest ...fns: MatchedMiddleware<C, "text">Rest Registers a middleware for handling /help
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<{ Rest Registers middleware for handling matching inline queries.
Rest ...fns: MatchedMiddleware<C, "inline_query">Rest Rest ...fns: Middleware<C>[]Rest Registers middleware for handling updates narrowed by update types or filter queries.
Rest ...fns: NonemptyReadonlyArray<Middleware<FilteredContext<C, Filter>>>Rest Registers middleware for handling updates narrowed by update types or message subtypes.
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, MountMap[Filter]>, MountMap[Filter]>>Rest Use filter utils instead. Support for Message subtype in Composer::on will be removed in Telegraf v5.
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<MessageReactionUpdate> & Omit<C, keyof Context<Update>> & { Rest Registers a middleware for handling /settings
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<{ Rest Registers a middleware for handling /start
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<{ Rest Registers a middleware.
Rest ...fns: readonly Middleware<C>[]Rest Static aclGenerates middleware responding only to specified users.
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>Rest Static actionGenerates middleware for handling matching callback queries.
Rest ...fns: MatchedMiddleware<C, "callback_query">Rest Static adminGenerates middleware responding only to chat admins and chat creator.
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>Rest Static branchmiddleware to run if the predicate returns true
middleware to run if the predicate returns false
Static cashtagRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static catchRest ...fns: readonly Middleware<C>[]Rest Static chatGenerates middleware running only in specified chat types.
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>Rest Static commandGenerates middleware for handling specified commands.
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<{ Rest Static composeStatic creatorGenerates middleware responding only to chat creator.
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>Rest Static dispatchStatic dropGenerates middleware for dropping matching updates.
Static emailRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static entityRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static filteruse Composer.drop
Static forkGenerates middleware that runs in the background.
Static gameGenerates middleware for handling game queries.
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, CallbackQueryUpdate<GameQuery>>>>Rest Static groupGenerates middleware running only in groups and supergroups.
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>Rest Static guardGenerates optional middleware based on a predicate that only operates on ctx.update.
Example:
import { Composer, Update } from 'telegraf'
const predicate = (u): u is Update.MessageUpdate => 'message' in u
const middleware = Composer.guard(predicate, (ctx) => {
const message = ctx.update.message
})
Note that Composer.on('message') is preferred over this.
predicate to decide whether to run the middleware based on the ctx.update object
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<C, U>, U>>middleware to run if the predicate returns true
Rest Composer.optional for a more generic version of this method that allows the predicate to operate on ctx itself
use Composer.on
Static hashtagRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static hearsGenerates middleware for handling matching text messages.
Rest ...fns: MatchedMiddleware<C, "text">Rest Static inlineGenerates middleware for handling matching inline queries.
Rest ...fns: MatchedMiddleware<C, "inline_query">Rest Static lazyStatic logStatic mentionRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static onGenerates middleware for handling updates narrowed by update types or filter queries.
Rest ...fns: NonemptyReadonlyArray<Middleware<FilteredContext<Ctx, Filter>>>Rest Generates middleware for handling updates narrowed by update types or message subtype.
Rest ...fns: NonemptyReadonlyArray<Middleware<NarrowedContext<Ctx, MountMap[Filter]>, MountMap[Filter]>>Rest Use filter utils instead. Support for Message subtype in Composer.on will be removed in Telegraf v5.
Static optionalGenerates optional middleware.
predicate to decide on a context object whether to run the middleware
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>middleware to run if the predicate returns true
Rest Static passGenerates middleware that gives up control to the next middleware.
Static phoneRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static privateGenerates middleware running only in private chats.
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>Rest Static reactionRest ...fns: NonemptyReadonlyArray<Middleware<Context<MessageReactionUpdate> & Omit<C, keyof Context<Update>> & { Rest Static replyRest ...args: [text: string | FmtString<string>, extra?: Omit<{}, "text" | "chat_id">]Rest Static spoilerRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static tapStatic textRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static textRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Static unwrapStatic urlRest ...fns: MatchedMiddleware<C, "channel_post" | "message">Rest Generated using TypeDoc
Generates middleware for handling provided update types.