Skip to content

Commit

Permalink
Merge pull request #61 from mindvalley/fix/try-to-get-correct-config
Browse files Browse the repository at this point in the history
Hack: Try to get the correct config of the prefixed channel
  • Loading branch information
onimsha authored Sep 19, 2024
2 parents 9898ae4 + 0d6a551 commit 1dfee07
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/danswer/danswerbot/slack/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ def get_slack_bot_config_for_channel(

slack_bot_configs = fetch_slack_bot_configs(db_session=db_session)
for config in slack_bot_configs:
if channel_name in config.channel_config[
"channel_names"
] or channel_name.startswith("inc-"):
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

return None
Expand Down

0 comments on commit 1dfee07

Please sign in to comment.