Send a typing indicator in bot-framework v4 using DirectLine and webchat (Node.js)

后端 未结 3 1811
无人及你
无人及你 2021-01-07 04:58

The official docs for Microsoft bot-framework SDK v4 do not demonstrate how to send a typing indicator (whereas v3 has these instructions). I\'m using DirectLine and botfram

3条回答
  •  感动是毒
    2021-01-07 05:40

    You can send a typing indicator by sending an activity with the typing type. Read more about how to send a typing indicator.

    await context.sendActivities([
                { type: ActivityTypes.Typing },
                { type: 'delay', value: 3000 },
                { type: ActivityTypes.Message, text: 'Finished typing' }
            ]);
    

    Also the showTypingMiddleware can be used to automatically send the typing indicator. This snippet will also show how to send a typing indicator, if you are looking for more sample code.

提交回复
热议问题