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

Restrict channel will will respond to in Slack #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion will/backends/io_adapters/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,16 @@ def normalize_incoming_event(self, event):
backend_supports_acl=True,
original_incoming_event=clean_for_pickling(event),
)
return m
# We have no control over what channels we join if we're a slack bot
# as such we have to check each message to see if it's from an allowed room
# and ignore if it's not
if hasattr(settings, "SLACK_ROOMS") and not is_private_chat:
if channel.name.lower() in settings.SLACK_ROOMS:
return m
else:
pass
else:
return m
else:
# An event type the slack ba has no idea how to handle.
pass
Expand Down