From 0a6698373281e60231305b5caf3af260255d4ffb Mon Sep 17 00:00:00 2001 From: xBytez Date: Mon, 23 May 2016 19:05:29 +0200 Subject: [PATCH] 1.3.9: Allow users to override the token when sending a request to Slack's API --- lib/index.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index aab917d..079e3e4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -97,7 +97,7 @@ util.inherits(slackAPI, eventEmitter); * @example reqAPI('rtm.start', {}, console.log) */ slackAPI.prototype.reqAPI = function (method, data, callback) { - data.token = this.token; + if(typeof data.token === 'undefined') data.token = this.token; if (typeof data.attachments !== 'undefined') { data.attachments = JSON.stringify(data.attachments); diff --git a/package.json b/package.json index 8c1577e..642fd5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slackbotapi", - "version": "1.3.8", + "version": "1.3.9", "description": "a node.js API using Slack their RTM API", "main": "lib/index.js", "scripts": {