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": {