Skip to content

@waylis/core


@waylis/core / SceneStep

Interface: SceneStep<K, T>

Defined in: src/scene/step.ts:21

Defines a single step in a scene.

Type Parameters

K

K extends string = string

T

T extends UserMessageBodyType = UserMessageBodyType

Properties

handler()?

ts
optional handler: (body: MessageBodyMap[T]) => Promise<void | SystemMessageBody>;

Defined in: src/scene/step.ts:34

Optional handler to process (validate) the user's reply.

Parameters

body

MessageBodyMap[T]

Message body matching the reply restriction type.

Returns

Promise<void | SystemMessageBody>

Optional system message response if processing (validation) fails.


key

ts
key: K;

Defined in: src/scene/step.ts:23

Unique key identifying the step.


prompt

ts
prompt: SystemMessageBody;

Defined in: src/scene/step.ts:25

Prompt message shown to the user.


reply

ts
reply: ExpectedReply<T>;

Defined in: src/scene/step.ts:27

Restriction on expected reply.

Released under the MIT License.