Skip to content

Commit

Permalink
Merge pull request #62 from mindvalley/fix/improve-channel-check-logic
Browse files Browse the repository at this point in the history
Try a different approach when checking prefixed channel
  • Loading branch information
onimsha authored Oct 2, 2024
2 parents 1dfee07 + bc317ab commit d7fadbc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions backend/danswer/danswerbot/slack/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ def get_slack_bot_config_for_channel(
for config in slack_bot_configs:
if channel_name in config.channel_config["channel_names"]:
return config
if any(
channel_name.startswith("inc-")
for channel_name in config.channel_config["channel_names"]
):
return config
if channel_name.startswith("inc-"):
# return the config that contains the string "inc-" in the channel name
if "inc-" in config.channel_config["channel_names"]:
return config

return None

Expand Down

0 comments on commit d7fadbc

Please sign in to comment.