ShowTypingMiddleware class

Middleware that will send a typing indicator automatically for each message.

Remarks

When added, this middleware will send typing activities back to the user when a Message activity is received to let them know that the bot has received the message and is working on the response. You can specify a delay in milliseconds before the first typing activity is sent and then a frequency, also in milliseconds which determines how often another typing activity is sent. Typing activities will continue to be sent until your bot sends another message back to the user

Constructors

ShowTypingMiddleware(number, number)

Create the SendTypingIndicator middleware

Methods

onTurn(TurnContext, () => Promise<void>)

Processes an incoming activity.

Constructor Details

ShowTypingMiddleware(number, number)

Create the SendTypingIndicator middleware

new ShowTypingMiddleware(delay?: number, period?: number)

Parameters

delay

number

Number of milliseconds to wait before sending the first typing indicator.

period

number

Number of milliseconds to wait before sending each following indicator.

Method Details

onTurn(TurnContext, () => Promise<void>)

Processes an incoming activity.

function onTurn(context: TurnContext, next: () => Promise<void>): Promise<void>

Parameters

context
TurnContext

An incoming TurnContext object.

next

() => Promise<void>

The next delegate function.

Returns

Promise<void>