scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 394 forks source link

Support comparing channel by name or id #109

Closed limdauto closed 7 years ago

limdauto commented 7 years ago

Thanks for the lovely library. I'm building a permission system for finer-grained access control to the bot, so inevitably, I stumbled upon the need to check whether some messages belong to certain channel. This PR is a direct port of the functionality in the official slackclient's channel object: https://github.com/slackhq/python-slackclient/blob/master/slackclient/_channel.py#L11-L15

wgins commented 7 years ago

@limdauto How are you using this in your run.py or equivalent? Looking to do the same, not sure where to start :)

limdauto commented 7 years ago

@wgins in your message handler, after this PR, you can do message.channel == "foo"