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

Commit

Permalink
Merge pull request #699 from mbensch/master
Browse files Browse the repository at this point in the history
Fixes slash commands when using internal webserver
  • Loading branch information
Ben Brown authored Mar 9, 2017
2 parents 94bbe03 + 101457a commit 3754bf6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/SlackBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,22 @@ function Slackbot(configuration) {

// Identify the bot from either team storage or identifyBot()
bot.team_info = team;
bot.identity = {
id: team.bot.user_id,
name: team.bot.name
};

// The bot identity is only used in handleEventsAPI during this flow
// Recent changes in Slack will break other integrations as they no longer
// require a bot and therefore Slack won't send the bot information.
if ( payload.type === 'event_callback' ) {

if( !team.bot ) {
slack_botkit.log.error('No bot identity found.');
return;
}

bot.identity = {
id: team.bot.user_id,
name: team.bot.name
};
}
}

bot.res = res;
Expand Down

0 comments on commit 3754bf6

Please sign in to comment.