Skip to content

Commit

Permalink
fix allowed_channel_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbam committed Jun 5, 2024
1 parent ac2213e commit 3db0505
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
ANTHROPIC_TOKENS = int(os.environ.get("ANTHROPIC_TOKENS", 1024))

# Set up the allowed channel ID
ALLOWED_CHANNEL_IDS = os.environ.get("ALLOWED_CHANNEL_IDS", "AAA,CCC,EEE,GGG")
ALLOWED_CHANNEL_IDS = os.environ.get("ALLOWED_CHANNEL_IDS", "")

ENABLE_IMAGE = os.environ.get("ENABLE_IMAGE", "False")

Expand Down Expand Up @@ -407,10 +407,11 @@ def handle_mention(body: dict, say: Say):

channel = event["channel"]

allowed_channel_ids = ALLOWED_CHANNEL_IDS.split(",")
if channel not in allowed_channel_ids:
# say("Sorry, I'm not allowed to respond in this channel.")
return
if ALLOWED_CHANNEL_IDS != "":
allowed_channel_ids = ALLOWED_CHANNEL_IDS.split(",")
if channel not in allowed_channel_ids:
# say("Sorry, I'm not allowed to respond in this channel.")
return

thread_ts = event["thread_ts"] if "thread_ts" in event else event["ts"]
user = event["user"]
Expand Down

0 comments on commit 3db0505

Please sign in to comment.