Registers middleware for handling matching callback queries.
Override error handling
Registers middleware for handling specified commands.
Registers middleware for dropping matching updates.
Registers middleware for handling game queries
Registers middleware for handling updates matching given type guard function.
Registers middleware for handling matching text messages.
Registers a middleware for handling /help
Registers middleware for handling matching inline queries.
Registers middleware for handling provided update types.
Registers a middleware for handling /settings
Registers a middleware for handling /start
Registers a middleware.
Generates middleware responding only to specified users.
Generates middleware for handling matching callback queries.
Generates middleware responding only to chat admins and chat creator.
middleware to run if the predicate returns true
middleware to run if the predicate returns false
Generates middleware running only in specified chat types.
Generates middleware for handling specified commands.
Generates middleware responding only to chat creator.
Generates middleware for dropping matching updates.
Generates middleware that runs in the background.
Generates middleware for handling game queries.
Generates middleware running only in groups and supergroups.
Generates 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
middleware to run if the predicate returns true
Generates middleware for handling matching text messages.
Generates middleware for handling matching inline queries.
Generates middleware for handling provided update types.
Generates middleware for handling provided update types.
Generates optional middleware.
predicate to decide on a context object whether to run the middleware
Generates middleware that gives up control to the next middleware.
Generates middleware running only in private chats.
Generated using TypeDoc
Set manually to avoid implicit
getMe
call inlaunch
orwebhookCallback