Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit 1dfee07

Browse files
authored
Merge pull request #61 from mindvalley/fix/try-to-get-correct-config
Hack: Try to get the correct config of the prefixed channel
2 parents 9898ae4 + 0d6a551 commit 1dfee07

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

backend/danswer/danswerbot/slack/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ def get_slack_bot_config_for_channel(
1919

2020
slack_bot_configs = fetch_slack_bot_configs(db_session=db_session)
2121
for config in slack_bot_configs:
22-
if channel_name in config.channel_config[
23-
"channel_names"
24-
] or channel_name.startswith("inc-"):
22+
if channel_name in config.channel_config["channel_names"]:
23+
return config
24+
if any(
25+
channel_name.startswith("inc-")
26+
for channel_name in config.channel_config["channel_names"]
27+
):
2528
return config
2629

2730
return None

0 commit comments

Comments
 (0)