Skip to content

GramIO API Reference / @gramio/scenes/dist / Scene

Class: Scene<Params, Errors, State, Derives>

Defined in: scenes/index.d.ts:606

Scene IS an EventComposer. Inherits the full gramio DSL (.command/.callbackQuery/.hears/.on/.use/.derive/.guard/.branch/.extend/...) and adds scene-specific methods (.params/.state/.exitData/.onEnter/.step/ .ask). Scene-specific data lives on this["~scene"] to avoid colliding with the composer's own ~ slot.

Extends

  • SceneComposerBase

Type Parameters

Type ParameterDefault type
Paramsnever
Errors extends ErrorDefinitionsobject
State extends StateTypesDefaultRecord<string, never>
Derives extends SceneDerivesDefinitions<Params, State, any>SceneDerivesDefinitions<Params, State>

Constructors

Constructor

new Scene<Params, Errors, State, Derives>(name?): Scene<Params, Errors, State, Derives>

Defined in: scenes/index.d.ts:628

Parameters

ParameterType
name?string

Returns

Scene<Params, Errors, State, Derives>

Overrides

SceneComposerBase.constructor

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
~object & objectOverride of the inherited composer's ~ slot to widen its Out (phantom TOut carrier) to include the scene's Derives["global"]. This is what makes ctx.scene visible inside scene-level event handlers (scene.callbackQuery / .command / .hears / .on / …): those methods type ctx via EventContextOf<this, E>, which reads Out from this slot. With the widening, ctx.scene is now present everywhere — both at the scene level AND inside step builders.SceneComposerBase.~-scenes/index.d.ts:618
~sceneSceneInternals<Params, State>Internal — scene-specific state. Stored on a dedicated slot so the composer's own ~ slot remains untouched. Generics here propagate Scene's Params / State into the structural shape so that Scene<{id}, ...> is distinct from Scene<never, ...> at the type level (needed by SceneEnterHandler to differentiate the no-params and with-params overloads at call sites).--scenes/index.d.ts:627
callbackQuery<TThis, Trigger>(this, trigger, handler, macroOptions?) => TThis & <TThis, Trigger>(this, trigger, handler, macroOptions?) => TThis--SceneComposerBase.callbackQuerygramio/index.d.ts:214
chosenInlineResult<TThis>(this, trigger, handler, macroOptions?) => TThis & <TThis>(this, trigger, handler, macroOptions?) => TThis--SceneComposerBase.chosenInlineResultgramio/index.d.ts:219
command<TThis>(this, command, handlerOrMeta, handlerOrOptions?, macroOptions?) => TThis & <TThis>(this, command, handlerOrMeta, handlerOrOptions?, macroOptions?) => TThis--SceneComposerBase.commandgramio/index.d.ts:215
hears<TThis>(this, trigger, handler, macroOptions?) => TThis & <TThis>(this, trigger, handler, macroOptions?) => TThis--SceneComposerBase.hearsgramio/index.d.ts:216
inlineQuery<TThis>(this, trigger, handler, options?) => TThis & <TThis>(this, triggerOrHandler, maybeHandler?, options?) => TThis--SceneComposerBase.inlineQuerygramio/index.d.ts:218
namestring---scenes/index.d.ts:607
reaction<TThis>(this, trigger, handler, macroOptions?) => TThis & <TThis>(this, trigger, handler, macroOptions?) => TThis--SceneComposerBase.reactiongramio/index.d.ts:217
startParameter<TThis>(this, parameter, handler, macroOptions?) => TThis & <TThis>(this, parameter, handler, macroOptions?) => TThis--SceneComposerBase.startParametergramio/index.d.ts:220
stepsCountnumber---scenes/index.d.ts:608

Methods

as()

as(scope): EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1>, Context<AnyBot$1>, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, { }> & object

Defined in: composer/index.d.ts:312

Parameters

ParameterType
scope"global" | "scoped"

Returns

EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1>, Context<AnyBot$1>, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, { }> & object

Inherited from

SceneComposerBase.as


ask()

ask<Key, Schema, Return>(key, validator, firstTimeMessage, options?): Scene<Params, Errors, Record<string, never> extends State ? Return : State & Return, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Record<string, never> extends State ? Return : State & Return; }>; }>; }>>

Defined in: scenes/index.d.ts:754

Type Parameters

Type ParameterDefault type
Key extends string-
Schema extends StandardSchemaV1<unknown, unknown>-
Return extends StateTypesDefault{ [key in string]: InferOutput<Schema> }

Parameters

ParameterTypeDescription
keyKey-
validatorSchema-
firstTimeMessageStringable-
options?{ onInvalidInput?: (issues) => Stringable; }-
options.onInvalidInput?(issues) => StringableCustom message when validation fails. Receives all issues from the validator.

Returns

Scene<Params, Errors, Record<string, never> extends State ? Return : State & Return, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Record<string, never> extends State ? Return : State & Return; }>; }>; }>>


branch()

branch(predicate, onTrue, onFalse?): this

Defined in: composer/index.d.ts:287

Parameters

ParameterType
predicateboolean | ((context) => boolean | Promise<boolean>)
onTrueMiddleware<Context<AnyBot$1>>
onFalse?Middleware<Context<AnyBot$1>>

Returns

this

Inherited from

SceneComposerBase.branch


compose()

compose(): ComposedMiddleware<Context<AnyBot$1>>

Defined in: composer/index.d.ts:322

Returns

ComposedMiddleware<Context<AnyBot$1>>

Inherited from

SceneComposerBase.compose


decorate()

Call Signature

decorate<D>(values): Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Defined in: scenes/index.d.ts:672

Override of .decorate that preserves Scene<...>. Same reason as .derive above — the base method widens TOut and drops the subclass.

Type Parameters
Type Parameter
D extends object
Parameters
ParameterType
valuesD
Returns

Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Overrides

SceneComposerBase.decorate

Call Signature

decorate<D>(values, options): Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Defined in: scenes/index.d.ts:675

Override of .decorate that preserves Scene<...>. Same reason as .derive above — the base method widens TOut and drops the subclass.

Type Parameters
Type Parameter
D extends object
Parameters
ParameterType
valuesD
options{ as: "global" | "scoped"; }
options.as"global" | "scoped"
Returns

Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Overrides

SceneComposerBase.decorate


derive()

Call Signature

derive<D>(handler): Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Defined in: scenes/index.d.ts:657

Type Parameters
Type Parameter
D extends object
Parameters
ParameterType
handlerDeriveHandler<MessageContext<Bot<{ }, DeriveDefinitions, { }>> & Require<MessageContext<Bot<{ }, DeriveDefinitions, { }>>, "from"> & Derives["global"], D>
Returns

Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Overrides

SceneComposerBase.derive

Call Signature

derive<D>(handler, options): Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Defined in: scenes/index.d.ts:660

Type Parameters
Type Parameter
D extends object
Parameters
ParameterType
handlerDeriveHandler<MessageContext<Bot<{ }, DeriveDefinitions, { }>> & Require<MessageContext<Bot<{ }, DeriveDefinitions, { }>>, "from"> & Derives["global"], D>
options{ as: "global" | "scoped"; }
options.as"global" | "scoped"
Returns

Scene<Params, Errors, State, Modify<Derives, { global: Derives["global"] & D; }>>

Overrides

SceneComposerBase.derive

Call Signature

derive<E, D>(event, handler): Scene<Params, Errors, State, Derives & { [K in UpdateName]: D }>

Defined in: scenes/index.d.ts:665

Type Parameters
Type Parameter
E extends UpdateName
D extends object
Parameters
ParameterType
eventMaybeArray<E>
handlerDeriveHandler<InstanceType<ContextsMapping<Bot<{ }, DeriveDefinitions, { }>>[E]> & DeriveDefinitions[E] & Derives["global"], D>
Returns

Scene<Params, Errors, State, Derives & { [K in UpdateName]: D }>

Overrides

SceneComposerBase.derive


dispatch()

dispatch(context, onNext?, passthrough?, skipFns?): Promise<void>

Defined in: scenes/index.d.ts:766

Parameters

ParameterTypeDescription
contextContext<Bot<{ }, DeriveDefinitions, { }>> & object-
onNext?() => unknown-
passthrough?Next-
skipFns?ReadonlySet<unknown>Middleware fns that have already run for this update (e.g. derive/ decorate pre-run so onEnter could see them in the legacy path) and must NOT run again here. They Object.assign onto the live ctx, so their effect persists — re-running would only re-fire side effects and double-count. Filtering by fn identity skips exactly those.

Returns

Promise<void>


dispatchActive()

dispatchActive(context, storage, key, data, passthrough?): Promise<void>

Defined in: scenes/index.d.ts:784

Parameters

ParameterType
contextContext<Bot<{ }, DeriveDefinitions, { }>> & object
storageStorage
keystring
dataScenesStorageData<unknown, unknown>
passthrough?Next

Returns

Promise<void>


error()

error(kind, errorClass): this

Defined in: composer/index.d.ts:295

Parameters

ParameterType
kindstring
errorClass{(...args): any; prototype: Error; }
errorClass.prototypeError

Returns

this

Inherited from

SceneComposerBase.error


exitData()

exitData<ExitData>(): Scene<Params, Errors, State, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { exitSub: (returnData?) => Promise<void>; }>; }>; }>>

Defined in: scenes/index.d.ts:644

Type Parameters

Type Parameter
ExitData extends Record<string, unknown>

Returns

Scene<Params, Errors, State, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { exitSub: (returnData?) => Promise<void>; }>; }>; }>>


extend()

Call Signature

extend<UParams, UErrors, UState, UDerives>(scene): Scene<Params, Errors & UErrors, Record<string, never> extends State ? UState : Record<string, never> extends UState ? State : State & UState, Derives & UDerives>

Defined in: scenes/index.d.ts:652

Merge another Scene's middlewares + lifecycle hooks + step list.

Type Parameters
Type Parameter
UParams
UErrors extends ErrorDefinitions
UState extends StateTypesDefault
UDerives extends SceneDerivesDefinitions<UParams, UState, any>
Parameters
ParameterType
sceneScene<UParams, UErrors, UState, UDerives>
Returns

Scene<Params, Errors & UErrors, Record<string, never> extends State ? UState : Record<string, never> extends UState ? State : State & UState, Derives & UDerives>

Overrides

SceneComposerBase.extend

Call Signature

extend<UExposed, UDerives>(composer): Scene<Params, Errors, State, Derives & object & UDerives>

Defined in: scenes/index.d.ts:653

Merge another Scene's middlewares + lifecycle hooks + step list.

Type Parameters
Type Parameter
UExposed extends object
UDerives extends Record<string, object>
Parameters
ParameterType
composerEventComposer<any, any, any, any, UExposed, UDerives, any>
Returns

Scene<Params, Errors, State, Derives & object & UDerives>

Overrides

SceneComposerBase.extend

Call Signature

extend<NewPlugin>(plugin): Scene<Params, Errors & NewPlugin["_"]["Errors"], State, Derives & NewPlugin["_"]["Derives"]>

Defined in: scenes/index.d.ts:656

Merge another Scene's middlewares + lifecycle hooks + step list.

Type Parameters
Type Parameter
NewPlugin extends AnyPlugin
Parameters
ParameterType
pluginNewPlugin
Returns

Scene<Params, Errors & NewPlugin["_"]["Errors"], State, Derives & NewPlugin["_"]["Derives"]>

Overrides

SceneComposerBase.extend


fork()

fork(...middleware): this

Defined in: composer/index.d.ts:291

Parameters

ParameterType
...middlewareMiddleware<Context<AnyBot$1>>[]

Returns

this

Inherited from

SceneComposerBase.fork


group()

group(fn): this

Defined in: composer/index.d.ts:299

Parameters

ParameterType
fn(composer) => void

Returns

this

Inherited from

SceneComposerBase.group


guard()

Call Signature

guard<Narrowing>(predicate): EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1> & Narrowing, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, { }> & object

Defined in: composer/index.d.ts:285

Type Parameters
Type Parameter
Narrowing
Parameters
ParameterType
predicate(context) => context is Narrowing
Returns

EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1> & Narrowing, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, { }> & object

Inherited from

SceneComposerBase.guard

Call Signature

guard<S>(predicate, ...middleware): this

Defined in: composer/index.d.ts:286

Type Parameters
Type Parameter
S extends Context<AnyBot$1>
Parameters
ParameterType
predicate((context) => context is S) | ((context) => boolean | Promise<boolean>)
...middlewareMiddleware<any>[]
Returns

this

Inherited from

SceneComposerBase.guard


guestQuery()

guestQuery<TThis>(this, triggerOrHandler, maybeHandler?, macroOptions?): TThis

Defined in: scenes/index.d.ts:190

Type Parameters

Type Parameter
TThis extends ComposerLike<TThis> & object

Parameters

ParameterType
thisTThis
triggerOrHandlerstring | RegExp | ((context) => boolean) | ((context) => unknown)
maybeHandler?(context) => unknown
macroOptions?Record<string, unknown>

Returns

TThis

Inherited from

SceneComposerBase.guestQuery


inspect()

inspect(): MiddlewareInfo[]

Defined in: composer/index.d.ts:319

Returns

MiddlewareInfo[]

Inherited from

SceneComposerBase.inspect


invalidate()

invalidate(): void

Defined in: composer/index.d.ts:342

Returns

void

Inherited from

SceneComposerBase.invalidate


lazy()

lazy(factory): this

Defined in: composer/index.d.ts:293

Parameters

ParameterType
factoryLazyFactory<Context<AnyBot$1>>

Returns

this

Inherited from

SceneComposerBase.lazy


macro()

Call Signature

macro<Name, TDef>(name, definition): EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1>, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, Record<Name, TDef>> & object

Defined in: composer/index.d.ts:316

Register a single named macro

Type Parameters
Type Parameter
Name extends string
TDef extends MacroDef<any, any>
Parameters
ParameterType
nameName
definitionTDef
Returns

EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1>, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, Record<Name, TDef>> & object

Inherited from

SceneComposerBase.macro

Call Signature

macro<TDefs>(definitions): EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1>, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, object & TDefs> & object

Defined in: composer/index.d.ts:318

Register multiple macros at once

Type Parameters
Type Parameter
TDefs extends Record<string, MacroDef<any, any>>
Parameters
ParameterType
definitionsTDefs
Returns

EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1>, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, object & TDefs> & object

Inherited from

SceneComposerBase.macro


on()

Call Signature

on<Narrowing>(filter, handler): this

Defined in: composer/index.d.ts:278

Type Parameters
Type Parameter
Narrowing
Parameters
ParameterType
filter(ctx) => ctx is Narrowing
handlerMiddleware<ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "message" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "edited_message" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "channel_post" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "edited_channel_post" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof BusinessConnectionContext<AnyBot$1> ? "business_connection" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "business_message" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "edited_business_message" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof BusinessMessagesDeletedContext<AnyBot$1> ? "deleted_business_messages" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageReactionContext<AnyBot$1> ? "message_reaction" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageReactionCountContext<AnyBot$1> ? "message_reaction_count" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof InlineQueryContext<AnyBot$1> ? "inline_query" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChosenInlineResultContext<AnyBot$1> ? "chosen_inline_result" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof CallbackQueryContext<AnyBot$1> ? "callback_query" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ShippingQueryContext<AnyBot$1> ? "shipping_query" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PreCheckoutQueryContext<AnyBot$1> ? "pre_checkout_query" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PaidMediaPurchasedContext<AnyBot$1> ? "purchased_paid_media" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PollContext<AnyBot$1> ? "poll" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PollAnswerContext<AnyBot$1> ? "poll_answer" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatMemberContext<AnyBot$1> ? "my_chat_member" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatMemberContext<AnyBot$1> ? "chat_member" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatJoinRequestContext<AnyBot$1> ? "chat_join_request" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatBoostContext<AnyBot$1> ? "chat_boost" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof RemovedChatBoostContext<AnyBot$1> ? "removed_chat_boost" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ManagedBotContext<AnyBot$1> ? "managed_bot" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof NewChatMembersContext<AnyBot$1> ? "new_chat_members" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof LeftChatMemberContext<AnyBot$1> ? "left_chat_member" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof NewChatTitleContext<AnyBot$1> ? "new_chat_title" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof NewChatPhotoContext<AnyBot$1> ? "new_chat_photo" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof DeleteChatPhotoContext<AnyBot$1> ? "delete_chat_photo" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GroupChatCreatedContext<AnyBot$1> ? "group_chat_created" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageAutoDeleteTimerChangedContext<AnyBot$1> ? "message_auto_delete_timer_changed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MigrateToChatIdContext<AnyBot$1> ? "migrate_to_chat_id" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MigrateFromChatIdContext<AnyBot$1> ? "migrate_from_chat_id" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PinnedMessageContext<AnyBot$1> ? "pinned_message" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof InvoiceContext<AnyBot$1> ? "invoice" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof SuccessfulPaymentContext<AnyBot$1> ? "successful_payment" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof RefundedPaymentContext<AnyBot$1> ? "refunded_payment" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof UsersSharedContext<AnyBot$1> ? "users_shared" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatSharedContext<AnyBot$1> ? "chat_shared" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GiftContext<AnyBot$1> ? "gift" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GiftUpgradeSentContext<AnyBot$1> ? "gift_upgrade_sent" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof UniqueGiftContext<AnyBot$1> ? "unique_gift" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatOwnerLeftContext<AnyBot$1> ? "chat_owner_left" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatOwnerChangedContext<AnyBot$1> ? "chat_owner_changed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PaidMessagePriceChangedContext<AnyBot$1> ? "paid_message_price_changed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ProximityAlertTriggeredContext<AnyBot$1> ? "proximity_alert_triggered" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof WriteAccessAllowedContext<AnyBot$1> ? "write_access_allowed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ForumTopicCreatedContext<AnyBot$1> ? "forum_topic_created" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ForumTopicEditedContext<AnyBot$1> ? "forum_topic_edited" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ForumTopicClosedContext<AnyBot$1> ? "forum_topic_closed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ForumTopicReopenedContext<AnyBot$1> ? "forum_topic_reopened" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GeneralForumTopicHiddenContext<AnyBot$1> ? "general_forum_topic_hidden" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GeneralForumTopicUnhiddenContext<AnyBot$1> ? "general_forum_topic_unhidden" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof VideoChatScheduledContext<AnyBot$1> ? "video_chat_scheduled" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof VideoChatStartedContext<AnyBot$1> ? "video_chat_started" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof VideoChatEndedContext<AnyBot$1> ? "video_chat_ended" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof VideoChatParticipantsInvitedContext<AnyBot$1> ? "video_chat_participants_invited" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof WebAppDataContext<AnyBot$1> ? "web_app_data" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof LocationContext<AnyBot$1> ? "location" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PassportDataContext<AnyBot$1> ? "passport_data" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GiveawayCreatedContext<AnyBot$1> ? "giveaway_created" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GiveawayCompletedContext<AnyBot$1> ? "giveaway_completed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof GiveawayWinnersContext<AnyBot$1> ? "giveaway_winners" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof BoostAddedContext<AnyBot$1> ? "boost_added" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChatBackgroundSetContext<AnyBot$1> ? "chat_background_set" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChecklistTasksDoneContext<AnyBot$1> ? "checklist_tasks_done" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ChecklistTasksAddedContext<AnyBot$1> ? "checklist_tasks_added" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof DirectMessagePriceChangedContext<AnyBot$1> ? "direct_message_price_changed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof SuggestedPostApprovedContext<AnyBot$1> ? "suggested_post_approved" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof SuggestedPostApprovalFailedContext<AnyBot$1> ? "suggested_post_approval_failed" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof SuggestedPostDeclinedContext<AnyBot$1> ? "suggested_post_declined" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof SuggestedPostPaidContext<AnyBot$1> ? "suggested_post_paid" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof SuggestedPostRefundedContext<AnyBot$1> ? "suggested_post_refunded" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof ManagedBotCreatedContext<AnyBot$1> ? "managed_bot_created" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PollOptionAddedContext<AnyBot$1> ? "poll_option_added" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof PollOptionDeletedContext<AnyBot$1> ? "poll_option_deleted" : never> | ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, keyof Narrowing & string extends keyof MessageContext<AnyBot$1> ? "service_message" : never> & Narrowing>
Returns

this

Inherited from

SceneComposerBase.on

Call Signature

on(filter, handler): this

Defined in: composer/index.d.ts:279

Parameters
ParameterType
filter(ctx) => boolean
handlerMiddleware<Context<AnyBot$1>>
Returns

this

Inherited from

SceneComposerBase.on

Call Signature

on<E, Narrowing>(event, filter, handler): this

Defined in: composer/index.d.ts:280

Type Parameters
Type Parameter
E extends "message" | "edited_message" | "channel_post" | "edited_channel_post" | "business_connection" | "business_message" | "edited_business_message" | "deleted_business_messages" | "message_reaction" | "message_reaction_count" | "inline_query" | "chosen_inline_result" | "callback_query" | "shipping_query" | "pre_checkout_query" | "purchased_paid_media" | "poll" | "poll_answer" | "my_chat_member" | "chat_member" | "chat_join_request" | "chat_boost" | "removed_chat_boost" | "managed_bot" | "new_chat_members" | "left_chat_member" | "new_chat_title" | "new_chat_photo" | "delete_chat_photo" | "group_chat_created" | "message_auto_delete_timer_changed" | "migrate_to_chat_id" | "migrate_from_chat_id" | "pinned_message" | "invoice" | "successful_payment" | "refunded_payment" | "users_shared" | "chat_shared" | "gift" | "gift_upgrade_sent" | "unique_gift" | "chat_owner_left" | "chat_owner_changed" | "paid_message_price_changed" | "proximity_alert_triggered" | "write_access_allowed" | "forum_topic_created" | "forum_topic_edited" | "forum_topic_closed" | "forum_topic_reopened" | "general_forum_topic_hidden" | "general_forum_topic_unhidden" | "video_chat_scheduled" | "video_chat_started" | "video_chat_ended" | "video_chat_participants_invited" | "web_app_data" | "location" | "passport_data" | "giveaway_created" | "giveaway_completed" | "giveaway_winners" | "boost_added" | "chat_background_set" | "checklist_tasks_done" | "checklist_tasks_added" | "direct_message_price_changed" | "suggested_post_approved" | "suggested_post_approval_failed" | "suggested_post_declined" | "suggested_post_paid" | "suggested_post_refunded" | "managed_bot_created" | "poll_option_added" | "poll_option_deleted" | "service_message"
Narrowing
Parameters
ParameterType
eventMaybeArray<E>
filter(ctx) => ctx is Narrowing
handlerMiddleware<ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, E> & Narrowing>
Returns

this

Inherited from

SceneComposerBase.on

Call Signature

on<E>(event, filter, handler): this

Defined in: composer/index.d.ts:281

Type Parameters
Type Parameter
E extends "message" | "edited_message" | "channel_post" | "edited_channel_post" | "business_connection" | "business_message" | "edited_business_message" | "deleted_business_messages" | "message_reaction" | "message_reaction_count" | "inline_query" | "chosen_inline_result" | "callback_query" | "shipping_query" | "pre_checkout_query" | "purchased_paid_media" | "poll" | "poll_answer" | "my_chat_member" | "chat_member" | "chat_join_request" | "chat_boost" | "removed_chat_boost" | "managed_bot" | "new_chat_members" | "left_chat_member" | "new_chat_title" | "new_chat_photo" | "delete_chat_photo" | "group_chat_created" | "message_auto_delete_timer_changed" | "migrate_to_chat_id" | "migrate_from_chat_id" | "pinned_message" | "invoice" | "successful_payment" | "refunded_payment" | "users_shared" | "chat_shared" | "gift" | "gift_upgrade_sent" | "unique_gift" | "chat_owner_left" | "chat_owner_changed" | "paid_message_price_changed" | "proximity_alert_triggered" | "write_access_allowed" | "forum_topic_created" | "forum_topic_edited" | "forum_topic_closed" | "forum_topic_reopened" | "general_forum_topic_hidden" | "general_forum_topic_unhidden" | "video_chat_scheduled" | "video_chat_started" | "video_chat_ended" | "video_chat_participants_invited" | "web_app_data" | "location" | "passport_data" | "giveaway_created" | "giveaway_completed" | "giveaway_winners" | "boost_added" | "chat_background_set" | "checklist_tasks_done" | "checklist_tasks_added" | "direct_message_price_changed" | "suggested_post_approved" | "suggested_post_approval_failed" | "suggested_post_declined" | "suggested_post_paid" | "suggested_post_refunded" | "managed_bot_created" | "poll_option_added" | "poll_option_deleted" | "service_message"
Parameters
ParameterType
eventMaybeArray<E>
filter(ctx) => boolean
handlerMiddleware<ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, E>>
Returns

this

Inherited from

SceneComposerBase.on

Call Signature

on<E, Patch>(event, handler): this

Defined in: composer/index.d.ts:282

Type Parameters
Type ParameterDefault type
E extends "message" | "edited_message" | "channel_post" | "edited_channel_post" | "business_connection" | "business_message" | "edited_business_message" | "deleted_business_messages" | "message_reaction" | "message_reaction_count" | "inline_query" | "chosen_inline_result" | "callback_query" | "shipping_query" | "pre_checkout_query" | "purchased_paid_media" | "poll" | "poll_answer" | "my_chat_member" | "chat_member" | "chat_join_request" | "chat_boost" | "removed_chat_boost" | "managed_bot" | "new_chat_members" | "left_chat_member" | "new_chat_title" | "new_chat_photo" | "delete_chat_photo" | "group_chat_created" | "message_auto_delete_timer_changed" | "migrate_to_chat_id" | "migrate_from_chat_id" | "pinned_message" | "invoice" | "successful_payment" | "refunded_payment" | "users_shared" | "chat_shared" | "gift" | "gift_upgrade_sent" | "unique_gift" | "chat_owner_left" | "chat_owner_changed" | "paid_message_price_changed" | "proximity_alert_triggered" | "write_access_allowed" | "forum_topic_created" | "forum_topic_edited" | "forum_topic_closed" | "forum_topic_reopened" | "general_forum_topic_hidden" | "general_forum_topic_unhidden" | "video_chat_scheduled" | "video_chat_started" | "video_chat_ended" | "video_chat_participants_invited" | "web_app_data" | "location" | "passport_data" | "giveaway_created" | "giveaway_completed" | "giveaway_winners" | "boost_added" | "chat_background_set" | "checklist_tasks_done" | "checklist_tasks_added" | "direct_message_price_changed" | "suggested_post_approved" | "suggested_post_approval_failed" | "suggested_post_declined" | "suggested_post_paid" | "suggested_post_refunded" | "managed_bot_created" | "poll_option_added" | "poll_option_deleted" | "service_message"-
Patch extends objectobject
Parameters
ParameterType
eventMaybeArray<E>
handlerMiddleware<ResolveEventCtx<Context<AnyBot$1>, TelegramEventMap$1, { }, E> & Patch>
Returns

this

Inherited from

SceneComposerBase.on


onEnter()

onEnter(handler): this

Defined in: scenes/index.d.ts:694

Register a handler that runs once when the user enters the scene.

Fires AFTER scene-level .derive() / .decorate() middleware has applied — so derived ctx fields (ctx.user, etc.) ARE available. Fires exactly once per scene occupancy: step.go(...) transitions don't re-trigger it.

Parameters

ParameterType
handler(context) => unknown

Returns

this

Example

ts
new Scene("checkout")
  .derive(async ctx => ({ user: await db.users.find(ctx.from!.id) }))
  .onEnter(ctx => analytics.track("checkout_start", { userId: ctx.user.id }))
  .step("review", c => c.message("Order looks good?").on("message", ...))

onError()

onError(handler): this

Defined in: composer/index.d.ts:294

Parameters

ParameterType
handlerErrorHandler<Context<AnyBot$1>>

Returns

this

Inherited from

SceneComposerBase.onError


onExit()

onExit(handler): this

Defined in: scenes/index.d.ts:702

Register a handler that runs when the user leaves this scene — on ctx.scene.exit(), ctx.scene.exitSub() (the sub-scene exits), and ctx.scene.reenter() (the prior occupancy of this scene ends before re-entry). Symmetric to .onEnter. Useful for cleanup, analytics, "thanks for completing" messages.

Parameters

ParameterType
handler(context) => unknown

Returns

this


params()

params<SceneParams>(): Scene<SceneParams, Errors, State, Modify<Derives, { global: { scene: Modify<Derives["global"]["scene"], { params: SceneParams; reenter: (params?) => Promise<void>; }>; }; }>>

Defined in: scenes/index.d.ts:629

Type Parameters

Type Parameter
SceneParams

Returns

Scene<SceneParams, Errors, State, Modify<Derives, { global: { scene: Modify<Derives["global"]["scene"], { params: SceneParams; reenter: (params?) => Promise<void>; }>; }; }>>


registeredEvents()

Call Signature

registeredEvents(): Set<string>

Defined in: composer/index.d.ts:320

Returns

Set<string>

Inherited from

SceneComposerBase.registeredEvents

Call Signature

registeredEvents(): Set<string>

Defined in: gramio/index.d.ts:213

Returns

Set<string>

Inherited from

SceneComposerBase.registeredEvents


route()

Call Signature

route<K>(router, cases, fallback?): this

Defined in: composer/index.d.ts:288

Type Parameters
Type Parameter
K extends string
Parameters
ParameterType
router(context) => K | Promise<K>
casesPartial<Record<K, (composer) => Composer<any, any, any>>>
fallback?(composer) => Composer<any, any, any>
Returns

this

Inherited from

SceneComposerBase.route

Call Signature

route<K>(router, builder): this

Defined in: composer/index.d.ts:289

Type Parameters
Type Parameter
K extends string
Parameters
ParameterType
router(context) => K | Promise<K>
builder(route) => void
Returns

this

Inherited from

SceneComposerBase.route

Call Signature

route<K>(router, cases, fallback?): this

Defined in: composer/index.d.ts:290

Type Parameters
Type Parameter
K extends string
Parameters
ParameterType
router(context) => K | Promise<K>
casesPartial<Record<K, Middleware<TOut> | Middleware<TOut>[] | Composer<any, any, any>>>
fallback?Composer<any, any, any, { }> | Middleware<Context<AnyBot$1>> | Middleware<Context<AnyBot$1>>[]
Returns

this

Inherited from

SceneComposerBase.route


run()

run(context, next?): Promise<void>

Defined in: composer/index.d.ts:323

Parameters

ParameterType
contextContext
next?Next

Returns

Promise<void>

Inherited from

SceneComposerBase.run


state()

state<StateParams>(): Scene<Params, Errors, StateParams, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: StateParams; }>; }>; }>>

Defined in: scenes/index.d.ts:637

Type Parameters

Type Parameter
StateParams extends StateTypesDefault

Returns

Scene<Params, Errors, StateParams, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: StateParams; }>; }>; }>>


step()

Call Signature

step<B, StepState>(builder): Scene<Params, Errors, Record<string, never> extends State ? StepState : State & StepState, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Record<string, never> extends State ? StepState : State & StepState; }>; }>; }>>

Defined in: scenes/index.d.ts:712

Builder, numeric step id (autoincrement).

The builder's return type is inspected for any Awaited<ReturnType<H>> that contains UpdateData<T> — i.e., any handler returning ctx.scene.update({…}). Those T's are merged into Scene's State generic automatically, so subsequent steps see ctx.scene.state.X properly typed without any .state<T>() annotation.

Type Parameters
Type ParameterDefault type
B extends (c) => unknown-
StepState extends objectExtractStepState<ReturnType<B>>
Parameters
ParameterType
builderB
Returns

Scene<Params, Errors, Record<string, never> extends State ? StepState : State & StepState, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Record<string, never> extends State ? StepState : State & StepState; }>; }>; }>>

Call Signature

step<T, Handler, Return>(updateName, handler): Scene<Params, Errors, Extract<Return, UpdateData<any>> extends UpdateData<Type> ? Record<string, never> extends State ? Type : State & Type : State, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Extract<Return, UpdateData<any>> extends UpdateData<Type> ? Record<string, never> extends State ? Type : State & Type : State; }>; }>; }>>

Defined in: scenes/index.d.ts:730

Legacy event-filtered step (single event name OR an array of events).

Listed BEFORE the named-builder overload so TS's overload resolution tries this first. T extends UpdateName then either succeeds (real event name like "message") and types ctx properly, OR fails so TS falls through to the named-builder overload. Result: step("message", (ctx, next) => …) types ctx as MessageContext, while step("intro", (c) => …) (with a name that's NOT a known event) cleanly resolves to the named-builder overload.

Type Parameters
Type ParameterDefault type
T extends UpdateName-
Handler extends StepHandler<InstanceType<ContextsMapping<Bot<{ }, DeriveDefinitions, { }>>[T]> & DeriveDefinitions[T] & Derives["global"] & Derives[T], any>-
ReturnAwaited<ReturnType<Handler>>
Parameters
ParameterType
updateNameMaybeArray<T>
handlerHandler
Returns

Scene<Params, Errors, Extract<Return, UpdateData<any>> extends UpdateData<Type> ? Record<string, never> extends State ? Type : State & Type : State, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Extract<Return, UpdateData<any>> extends UpdateData<Type> ? Record<string, never> extends State ? Type : State & Type : State; }>; }>; }>>

Call Signature

step<B, StepState>(name, builder): Scene<Params, Errors, Record<string, never> extends State ? StepState : State & StepState, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Record<string, never> extends State ? StepState : State & StepState; }>; }>; }>>

Defined in: scenes/index.d.ts:741

Builder, named step id. Same state-inference behavior as the numeric form — any update({…}) calls inside handlers widen State.

Type Parameters
Type ParameterDefault type
B extends (c) => unknown-
StepState extends objectExtractStepState<ReturnType<B>>
Parameters
ParameterType
namestring
builderB
Returns

Scene<Params, Errors, Record<string, never> extends State ? StepState : State & StepState, Modify<Derives, { global: Modify<Derives["global"], { scene: Modify<Derives["global"]["scene"], { state: Record<string, never> extends State ? StepState : State & StepState; }>; }>; }>>


tap()

tap(...middleware): this

Defined in: composer/index.d.ts:292

Parameters

ParameterType
...middlewareMiddleware<Context<AnyBot$1>>[]

Returns

this

Inherited from

SceneComposerBase.tap


trace()

trace(handler): this

Defined in: composer/index.d.ts:321

Parameters

ParameterType
handlerTraceHandler

Returns

this

Inherited from

SceneComposerBase.trace


use()

Call Signature

use<Patch>(handler): this

Defined in: composer/index.d.ts:283

Type Parameters
Type Parameter
Patch extends object
Parameters
ParameterType
handlerMiddleware<Context<AnyBot$1> & Patch>
Returns

this

Inherited from

SceneComposerBase.use

Call Signature

use(...middleware): this

Defined in: composer/index.d.ts:284

Parameters
ParameterType
...middlewareMiddleware<Context<AnyBot$1>>[]
Returns

this

Inherited from

SceneComposerBase.use


when()

when<UOut>(condition, fn): EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1> & Partial<Omit<UOut, keyof Context<AnyBot$1>>>, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, { }> & object

Defined in: composer/index.d.ts:311

Type Parameters

Type Parameter
UOut extends Context<AnyBot$1>

Parameters

ParameterType
conditionboolean
fn(composer) => Composer<Context<AnyBot$1>, UOut, any>

Returns

EventComposer<Context<AnyBot$1>, TelegramEventMap$1, Context<AnyBot$1>, Context<AnyBot$1> & Partial<Omit<UOut, keyof Context<AnyBot$1>>>, { }, { }, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; guestQuery: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }, { }> & object

Inherited from

SceneComposerBase.when