Skip to content

Commit

Permalink
Try a different approach when checking prefixed channel
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Co <alex.tuan@mindvalley.com>
  • Loading branch information
onimsha committed Oct 2, 2024
1 parent 1dfee07 commit bc317ab
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 bc317ab

Please sign in to comment.