From bc317ab2a76c7664fe4f76ef9945177ff9d2a500 Mon Sep 17 00:00:00 2001 From: Alex Co Date: Wed, 2 Oct 2024 09:04:22 +0000 Subject: [PATCH] Try a different approach when checking prefixed channel Signed-off-by: Alex Co --- backend/danswer/danswerbot/slack/config.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/danswer/danswerbot/slack/config.py b/backend/danswer/danswerbot/slack/config.py index 1b941c623bf..3f3f211419e 100644 --- a/backend/danswer/danswerbot/slack/config.py +++ b/backend/danswer/danswerbot/slack/config.py @@ -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