Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Adds documentation for the typingDelayFactor as an additional configu… #9

Merged
merged 1 commit into from
Jul 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/readme-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -51,6 +52,7 @@ var controller = Botkit.slackbot({
debug: false,
replyWithTyping: true,
studio_token: process.env.studio_token,
typingDelayFactor: 1.3
});
```

Expand Down Expand Up @@ -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)
Expand Down