OptionalbotReadonlycontextAssign to this to customise the webhook filter middleware.
{ path, secretToken } will be bound to this rather than the Tgify instance.
Remember to assign a regular function and not an arrow function so it's bindable.
StaticmountGenerates middleware for handling provided update types.
Generates middleware for handling updates narrowed by update types or filter queries.
Generates middleware for handling updates narrowed by update types or message subtype.
Registers middleware for handling matching callback queries.
Registers middleware for handling specified commands.
Specify a url to receive incoming updates via webhook. Returns an Express-style middleware you can pass to app.use()
Registers middleware for handling game queries
Registers middleware for handling updates matching given type guard function.
OptionalwebhookResponse: ServerResponse<IncomingMessage>Registers middleware for handling matching text messages.
Registers a middleware for handling /help
Registers middleware for handling matching inline queries.
OptionalonLaunch: () => voidOptionalonLaunch: () => voidRegisters middleware for handling updates narrowed by update types or filter queries.
Registers middleware for handling updates narrowed by update types or message subtypes.
Registers a middleware for handling /settings
You must call bot.telegram.setWebhook for this to work.
You should probably use Tgify.createWebhook instead.
StaticaclGenerates middleware responding only to specified users.
StaticactionGenerates middleware for handling matching callback queries.
StaticadminGenerates middleware responding only to chat admins and chat creator.
Staticbranchmiddleware to run if the predicate returns true
middleware to run if the predicate returns false
StaticcashtagStaticcatchStaticchatGenerates middleware running only in specified chat types.
StaticcommandGenerates middleware for handling specified commands.
StaticcomposeStaticcreatorGenerates middleware responding only to chat creator.
StaticdispatchStaticdropGenerates middleware for dropping matching updates.
StaticemailStaticentityStaticfilterStaticforkGenerates middleware that runs in the background.
StaticgameGenerates middleware for handling game queries.
StaticgroupGenerates middleware running only in groups and supergroups.
StaticguardGenerates 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
StatichashtagStatichearsGenerates middleware for handling matching text messages.
StaticinlineGenerates middleware for handling matching inline queries.
StaticlazyStaticlogStaticmentionStaticonGenerates middleware for handling updates narrowed by update types or filter queries.
Generates middleware for handling updates narrowed by update types or message subtype.
StaticoptionalGenerates optional middleware.
predicate to decide on a context object whether to run the middleware
middleware to run if the predicate returns true
StaticpassGenerates middleware that gives up control to the next middleware.
StaticphoneStaticprivateGenerates middleware running only in private chats.
StaticreactionStaticreplyStaticspoilerStatictapStatictextStatictextStaticunwrapStaticurl
Set manually to avoid implicit
getMecall inlaunchorwebhookCallback