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

Commit

Permalink
update docs to properly reflect where retry, send_via_rtm preferences…
Browse files Browse the repository at this point in the history
… should be set on the controller
  • Loading branch information
Ben Brown committed Dec 19, 2016
1 parent f4c50f0 commit 2e73bcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions lib/Slackbot_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ module.exports = function(botkit, config) {
var retryBackoff = null;

// config.retry, can be Infinity too
var retryEnabled = bot.config.retry ? true : false;
var maxRetry = isNaN(bot.config.retry) || bot.config.retry <= 0 ? 3 : bot.config.retry;
var retryEnabled = bot.config.retry ? true : (botkit.config.retry ? true : false);
var maxRetry = null;
if (bot.config.retry) {
maxRetry = isNaN(bot.config.retry) || bot.config.retry <= 0 ? 3 : bot.config.retry;
} else if (botkit.config.retry) {
maxRetry = isNaN(botkit.config.retry) || botkit.config.retry <= 0 ? 3 : botkit.config.retry;
}

/**
* Set up API to send incoming webhook
Expand Down
6 changes: 3 additions & 3 deletions readme-slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ var controller = Botkit.slackbot({debug: true})
|--- |--- |---
| debug | Boolean | Enable debug logging
| stale_connection_timeout | Positive integer | Number of milliseconds to wait for a connection keep-alive "pong" response before declaring the connection stale. Default is `12000`

| send_via_rtm | Boolean | Send outgoing messages via the RTM instead of using Slack's RESTful API which supports more features
| retry | Positive integer or `Infinity` | Maximum number of reconnect attempts after failed connection to Slack's real time messaging API. Retry is disabled by default

#### controller.spawn()
| Argument | Description
Expand All @@ -126,8 +127,7 @@ Spawn `config` object accepts these properties:
| Name | Value | Description
|--- |--- |---
| token | String | Slack bot token
| send_via_rtm | Boolean | Send outgoing messages via the RTM instead of using Slack's RESTful API which supports more features
| retry | Positive integer or `Infinity` | Maximum number of reconnect attempts after failed connection to Slack's real time messaging API. Retry is disabled by default


### Require Delivery Confirmation for RTM Messages

Expand Down

0 comments on commit 2e73bcf

Please sign in to comment.