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

Fix bot_channel_join and bot_group_join with Slack Events API #514

Merged
merged 4 commits into from
Dec 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/SlackBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,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') {

Copy link

@bertiful bertiful Dec 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line.

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 @@ -682,7 +682,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 @@ -691,7 +691,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