Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add blacklist/whitelist support back in, especially #general #214

Closed
bitflingr opened this issue Jul 28, 2015 · 13 comments
Closed

add blacklist/whitelist support back in, especially #general #214

bitflingr opened this issue Jul 28, 2015 · 13 comments

Comments

@bitflingr
Copy link

I am in a team with hundreds of users and we would like to keep communication down to a minimum. Unfortunately Hubot likes to autojoin to #general. Not sure if this is part of the Slack API but if so we should have hubot ignore all messages from #general and any other channel that my not benefit from it. I understand that it is restricted by invitation but if so, lets at least add the option to ignore #general.

@bitflingr
Copy link
Author

so i can not track to see if hubot was ever invited to #general, but still a nice feature to have in case it was ever invited.

@bitflingr
Copy link
Author

I have added a whitelist regex in a forked version and so far so good.

https://github.com/GravityLabs/hubot-slack/commit/6bfae0202ea8f1124cd27dcad2e31183c42c411f

@scarolan
Copy link

scarolan commented Aug 2, 2015

I would also like to see this feature, as I work on a team where I don't have /kick rights to any channels, but we do have our own bot for my group's channel. It would be nice to be able to forbid the bot from joining #general

@michaeljacobdavis
Copy link

+1 Beyond just general, there is nothing stopping anyone else inviting the bot into their channel and using it.

Just out of curiosity, it looks like this was implemented in #15. Any reason it was removed?

@samuelcouch
Copy link

Couldn't this be implemented as a middleware? Catch all incoming messages, filter against a whitelist/blacklist and proceed as necessary.

@michaeljacobdavis
Copy link

@samuelcouch Sorry, I'm totally new to hubot. Didn't realize this was a thing. I'll have to look into it. Thanks!

@samuelcouch
Copy link

No worries at all! https://github.com/github/hubot/blob/master/docs/scripting.md#middleware is the relevant portion that I'm thinking could be used.

@michaeljacobdavis
Copy link

Wow... That was ridiculously easy.

If anyone else wants to use it, hubot-slack-whitelist-middleware

npm install --save hubot-slack-whitelist-middleware

Thanks @samuelcouch!

@samuelcouch
Copy link

Rad! Glad it worked @michaeljacobdavis

@scarolan
Copy link

How can we help move this forward? @bitflingr did you create a PR for your fork? I published your code as a separate npm module.

https://www.npmjs.com/package/hubot-slack-whitelist

It would be better if we could get this code back into hubot-slack master branch and the main hubot-slack npm package.

Surely there are other Slack teams who need this capability.

@michaeljacobdavis
Copy link

@scarolan As @samuelcouch mentioned, any reason this shouldn't be middleware? You can do it in 6 lines of code if you want to implement it or just use hubot-slack-whitelist-middleware.

If it doesn't do what you want, feel free to open a pull request with new features.

@unstablereality
Copy link

The issue I've found with the middleware is the bot stops responding to private messages when I've got it installed. I've tried to figure out how to fix the issue, but I don't understand it well enough to fix it myself.

@DEGoodmanWilson
Copy link

Unfortunately, hubot-slack really isn't the place to implement this functionality. The middleware approach strikes me as well as being the right level to address this request, so I am going to close this issue as won't fix. Requests for additional functionality along these lines should probably be directed here https://github.com/michaeljacobdavis/hubot-slack-whitelist-middleware/issues

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

No branches or pull requests

6 participants