From e0379fe63fa07afe5cc038ecd8b5b5f658702772 Mon Sep 17 00:00:00 2001 From: lisa_schmitz Date: Thu, 28 Jun 2018 14:52:57 +0200 Subject: [PATCH] Adds documentation for the typingDelayFactor as an additional configuration option for the Webbot --- docs/readme-web.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/readme-web.md b/docs/readme-web.md index 08c7f47..b568a42 100644 --- a/docs/readme-web.md +++ b/docs/readme-web.md @@ -43,6 +43,7 @@ The `config` argument is an object with these properties: | studio_token | String | An API token from [Botkit Studio](#readme-studio.md) | debug | Boolean | Enable debug logging | replyWithTyping | Boolean | Send typing indicators automatically (default false) +| typingDelayFactor | Float | Adjust the speed of the typing delay For example: @@ -51,6 +52,7 @@ var controller = Botkit.slackbot({ debug: false, replyWithTyping: true, studio_token: process.env.studio_token, + typingDelayFactor: 1.3 }); ``` @@ -141,6 +143,17 @@ It connects a `ws` powered websocket server to the web server, and allows the ap [A compatible webserver is provided in the starter kit](https://github.com/howdyai/botkit-starter-web/blob/master/components/express_webserver.js). +#### controller.setTypingDelayFactor(delayFactor); + +Adjust the speed of the typing delay by setting a factor. The typing delay determines the time that the bot takes, to reply to a message. By default, the factor is set to 1, using a predefined calculation for the typing delay, that takes the message length into account. In order to increase or decrease the typing delay, the factor can be changed. For example, the default typing delay can be doubled by setting the factor to 2. + +**For example:** + +``` +// double the time of the typing delay +controller.setTypingDelayFactor(2); +``` + ## Additional Bot Instance Methods #### bot.replyWithTyping(message, reply)