serverless-slack
Advanced tools
Comparing version 1.0.18 to 1.0.19
{ | ||
"name": "serverless-slack", | ||
"description": "A Slack App Framework for AWS Lambda / Serverless.js", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "author": "John Agan <john@slack-corp.com>", |
@@ -41,5 +41,6 @@ 'use strict'; | ||
get channel() { | ||
let payload = this.payload; | ||
let event = payload.event; | ||
if (payload) { | ||
let payload = this.payload, event = payload.event, auth = this.auth; | ||
if (auth.incoming_webhook) { | ||
return auth.incoming_webhook.channel_id; | ||
} else if (payload) { | ||
if (payload.channel_id) return payload.channel_id; | ||
@@ -59,5 +60,4 @@ else if (payload.channel) return payload.channel.id; | ||
get token() { | ||
let auth = this.auth; | ||
let bot = auth.bot; | ||
if (auth) return auth.bot ? auth.bot.bot_access_token : auth.access_token; | ||
let auth = this.auth || {}, bot = auth.bot; | ||
return auth.bot ? auth.bot.bot_access_token : auth.access_token; | ||
} | ||
@@ -64,0 +64,0 @@ |
10179