Constructors
constructor
-
Type parameters
Parameters
Methods
action
- action(triggers: Triggers<C>, ...fns: MatchedMiddleware<C, "callback_query">): Composer<C>
-
Parameters
-
triggers: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "callback_query">
cashtag
- cashtag(cashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
cashtag: MaybeArray<string>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
command
- command(command: MaybeArray<string>, ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>): Composer<C>
-
Parameters
-
command: MaybeArray<string>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>
drop
- drop(predicate: Predicate<C>): Composer<C>
email
- email(email: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
email: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Private entity
- entity<T>(predicate: MaybeArray<string> | ((entity: MessageEntity, s: string, ctx: C) => boolean), ...fns: readonly Middleware<MatchedContext<C, T>>[]): Composer<C>
-
Type parameters
-
T: "message" | "channel_post" | MessageSubType = "message" | "channel_post"
Parameters
-
predicate: MaybeArray<string> | ((entity: MessageEntity, s: string, ctx: C) => boolean)
-
Rest ...fns: readonly Middleware<MatchedContext<C, T>>[]
filter
- filter(predicate: Predicate<C>): Composer<C>
guard
-
Type parameters
Parameters
-
guardFn: (update: Update) => update is U
-
- (update: Update): update is U
-
Parameters
Returns update is U
-
hashtag
- hashtag(hashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
hashtag: MaybeArray<string>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
hears
- hears(triggers: Triggers<C>, ...fns: MatchedMiddleware<C, "text">): Composer<C>
-
Parameters
-
triggers: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "text">
help
-
Parameters
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>
inlineQuery
- inlineQuery(triggers: Triggers<C>, ...fns: MatchedMiddleware<C, "inline_query">): Composer<C>
-
Parameters
-
triggers: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "inline_query">
mention
- mention(mention: MaybeArray<string>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
mention: MaybeArray<string>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
on
- on<T>(updateType: MaybeArray<T>, ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, T>>>): Composer<C>
-
Type parameters
-
T: "text" | "callback_query" | "message" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query" | "forward_date" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "proximity_alert_triggered" | "pinned_message" | "successful_payment" | "supergroup_chat_created" | "voice_chat_scheduled" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "animation" | "document" | "audio" | "contact" | "dice" | "game" | "location" | "photo" | "sticker" | "venue" | "video" | "video_note" | "voice"
Parameters
-
updateType: MaybeArray<T>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, T>>>
phone
- phone(number: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
number: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
settings
- settings(...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>): Composer<C>
-
Parameters
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>
start
- start(...fns: NonemptyReadonlyArray<Middleware<Context<{ message: New & NonChannel & TextMessage; update_id: number }> & Omit<C, keyof Context<Update>> & { startPayload: string }>>): Composer<C>
-
Parameters
-
Rest ...fns: NonemptyReadonlyArray<Middleware<Context<{ message: New & NonChannel & TextMessage; update_id: number }> & Omit<C, keyof Context<Update>> & { startPayload: string }>>
textLink
- textLink(link: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
link: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
textMention
- textMention(mention: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
mention: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
url
- url(url: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): Composer<C>
-
Parameters
-
url: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static acl
-
Type parameters
Parameters
-
userId: MaybeArray<number>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>
Static action
- action<C>(triggers: Triggers<C>, ...fns: MatchedMiddleware<C, "callback_query">): MiddlewareFn<C>
-
Type parameters
Parameters
-
triggers: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "callback_query">
Static admin
-
Type parameters
Parameters
Static branch
-
Type parameters
Parameters
-
predicate: Predicate<C> | AsyncPredicate<C>
-
-
Static cashtag
- cashtag<C>(cashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
cashtag: MaybeArray<string>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static catch
-
Type parameters
Parameters
-
errorHandler: (err: unknown, ctx: C) => void
-
- (err: unknown, ctx: C): void
-
Rest ...fns: readonly Middleware<C>[]
Static chatType
- chatType<C>(type: MaybeArray<"channel" | "private" | "group" | "supergroup">, ...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>
-
Type parameters
Parameters
-
type: MaybeArray<"channel" | "private" | "group" | "supergroup">
-
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>
Static command
- command<C>(command: MaybeArray<string>, ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>): MiddlewareFn<C>
-
Type parameters
Parameters
-
command: MaybeArray<string>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, "text">>>
Static compose
-
Type parameters
Parameters
Static creator
-
Type parameters
Parameters
Static dispatch
- dispatch<C, Handlers>(routeFn: (ctx: C) => MaybePromise<keyof Handlers>, handlers: Handlers): Middleware<C>
-
Type parameters
-
-
Handlers: Record<string | number | symbol, Middleware<C>>
Parameters
-
routeFn: (ctx: C) => MaybePromise<keyof Handlers>
-
- (ctx: C): MaybePromise<keyof Handlers>
-
Parameters
Returns MaybePromise<keyof Handlers>
-
handlers: Handlers
Static drop
-
Type parameters
Parameters
Static email
- email<C>(email: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
email: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Private Static entity
- entity<C, T>(predicate: MaybeArray<string> | ((entity: MessageEntity, s: string, ctx: C) => boolean), ...fns: readonly Middleware<MatchedContext<C, T>>[]): MiddlewareFn<C>
-
Type parameters
-
-
T: "message" | "channel_post" | MessageSubType = "message" | "channel_post"
Parameters
-
predicate: MaybeArray<string> | ((entity: MessageEntity, s: string, ctx: C) => boolean)
-
Rest ...fns: readonly Middleware<MatchedContext<C, T>>[]
Static entityText
- entityText<C>(entityType: MaybeArray<string>, predicate: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
entityType: MaybeArray<string>
-
predicate: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static filter
-
Type parameters
Parameters
Static fork
-
Type parameters
Parameters
Static gameQuery
-
Type parameters
Parameters
Static groupChat
-
Type parameters
Parameters
Static guard
-
Type parameters
Parameters
-
guardFn: (u: Update) => u is U
-
-
Parameters
Returns u is U
-
Static hashtag
- hashtag<C>(hashtag: MaybeArray<string>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
hashtag: MaybeArray<string>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static hears
- hears<C>(triggers: Triggers<C>, ...fns: MatchedMiddleware<C, "text">): MiddlewareFn<C>
-
Type parameters
Parameters
-
triggers: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "text">
Static inlineQuery
- inlineQuery<C>(triggers: Triggers<C>, ...fns: MatchedMiddleware<C, "inline_query">): MiddlewareFn<C>
-
Type parameters
Parameters
-
triggers: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "inline_query">
Static lazy
-
Type parameters
Parameters
Static log
-
Parameters
-
logFn: (s: string) => void = ...
Private Static match
- match<C, T>(triggers: readonly ((text: string, ctx: C) => null | RegExpExecArray)[], ...fns: MatchedMiddleware<C, T>): MiddlewareFn<MatchedContext<C, T>>
-
Type parameters
-
-
T: "callback_query" | "message" | "channel_post" | "inline_query" | MessageSubType
Parameters
-
triggers: readonly ((text: string, ctx: C) => null | RegExpExecArray)[]
-
Rest ...fns: MatchedMiddleware<C, T>
Returns MiddlewareFn<MatchedContext<C, T>>
Private Static memberStatus
- memberStatus<C>(status: MaybeArray<"creator" | "administrator" | "member" | "restricted" | "left" | "kicked">, ...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>
-
Type parameters
Parameters
-
status: MaybeArray<"creator" | "administrator" | "member" | "restricted" | "left" | "kicked">
-
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>
Static mention
- mention<C>(mention: MaybeArray<string>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
mention: MaybeArray<string>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static mount
- mount<C, T>(updateType: MaybeArray<T>, ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, T>>>): MiddlewareFn<C>
-
Type parameters
-
-
T: "text" | "callback_query" | "message" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query" | "forward_date" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "proximity_alert_triggered" | "pinned_message" | "successful_payment" | "supergroup_chat_created" | "voice_chat_scheduled" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "animation" | "document" | "audio" | "contact" | "dice" | "game" | "location" | "photo" | "sticker" | "venue" | "video" | "video_note" | "voice"
Parameters
-
updateType: MaybeArray<T>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, T>>>
Static on
- on<C, T>(updateType: MaybeArray<T>, ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, T>>>): MiddlewareFn<C>
-
Type parameters
-
-
T: "text" | "callback_query" | "message" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query" | "forward_date" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "proximity_alert_triggered" | "pinned_message" | "successful_payment" | "supergroup_chat_created" | "voice_chat_scheduled" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "animation" | "document" | "audio" | "contact" | "dice" | "game" | "location" | "photo" | "sticker" | "venue" | "video" | "video_note" | "voice"
Parameters
-
updateType: MaybeArray<T>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<MatchedContext<C, T>>>
Static optional
- optional<C>(predicate: Predicate<C> | AsyncPredicate<C>, ...fns: NonemptyReadonlyArray<Middleware<C>>): MiddlewareFn<C>
-
Type parameters
Parameters
-
predicate: Predicate<C> | AsyncPredicate<C>
-
Rest ...fns: NonemptyReadonlyArray<Middleware<C>>
Static phone
- phone<C>(number: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
number: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static privateChat
-
Type parameters
Parameters
Static tap
-
Type parameters
Parameters
Static textLink
- textLink<C>(link: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
link: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static textMention
- textMention<C>(mention: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
mention: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Static unwrap
-
Type parameters
Parameters
Static url
- url<C>(url: Triggers<C>, ...fns: MatchedMiddleware<C, "message" | "channel_post">): MiddlewareFn<C>
-
Type parameters
Parameters
-
url: Triggers<C>
-
Rest ...fns: MatchedMiddleware<C, "message" | "channel_post">
Registers middleware for handling matching callback queries.