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

Conversation

jonchurch
Copy link
Contributor

@jonchurch jonchurch commented Nov 26, 2016

Events API does not pass bot_id to channel_join and group_join events, which we were checking for in order to determine if it was the bot which joined the channel or group.

This restores expected behavior

I added an exception for channel and group joins to filtering out events associated with our bot user, I think this is the only event we listen to with slack that has our bot's user id as the user: id so I think this should be fine for now.

closes #347

Copy link

@bertiful bertiful left a comment

Choose a reason for hiding this comment

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

Minor comment, rest looks good. Thanks for fixing this @jonchurch 👍

@@ -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.

@benbrown benbrown merged commit aa5e2cb into howdyai:master Dec 19, 2016
@JimLynchCodes
Copy link

JimLynchCodes commented Apr 23, 2019

I am so confused. It looks like the code is still checking for team.bot.user_is, and the bot_channel_join event is still not working in the botkit starter apps...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bot_channel_join event not firing when bot is invited to a channel
5 participants