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 #514 from jonchurch/issue347fix
Browse files Browse the repository at this point in the history
Fix bot_channel_join and bot_group_join with Slack Events API
  • Loading branch information
Ben Brown authored Dec 19, 2016
2 parents ed93974 + 8d95781 commit aa5e2cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/SlackBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ function Slackbot(configuration) {
id: team.bot.user_id,
name: team.bot.name
};
if (team.bot.user_id === req.body.event.user && req.body.event.subtype !== 'channel_join' && req.body.event.subtype !== 'group_join') {

if (team.bot.user_id === req.body.event.user) {
slack_botkit.debug('Got event from this bot user, ignoring it');
return;
}
Expand Down Expand Up @@ -696,7 +696,7 @@ function Slackbot(configuration) {
// set up a couple of special cases based on subtype
if (message.subtype && message.subtype == 'channel_join') {
// someone joined. maybe do something?
if (message.user == bot.identity.id && message.bot_id) {
if (message.user == bot.identity.id) {
slack_botkit.trigger('bot_channel_join', [bot, message]);
return false;
} else {
Expand All @@ -705,7 +705,7 @@ function Slackbot(configuration) {
}
} else if (message.subtype && message.subtype == 'group_join') {
// someone joined. maybe do something?
if (message.user == bot.identity.id && message.bot_id) {
if (message.user == bot.identity.id) {
slack_botkit.trigger('bot_group_join', [bot, message]);
return false;
} else {
Expand Down

0 comments on commit aa5e2cb

Please sign in to comment.