2323 forward_event_to_pull_request_lambda ,
2424 gate_common ,
2525 respond_with_eyes ,
26+ should_reply_to_message ,
2627)
2728from app .slack .slack_events import process_async_slack_action , process_async_slack_event
2829
@@ -49,7 +50,8 @@ def setup_handlers(app: App) -> None:
4950
5051# ack function for events where we respond with eyes
5152def respond_to_events (event : Dict [str , Any ], ack : Ack , client : WebClient ):
52- respond_with_eyes (event = event , client = client )
53+ if should_reply_to_message (event ):
54+ respond_with_eyes (event = event , client = client )
5355 logger .debug ("Sending ack response" )
5456 ack ()
5557
@@ -94,8 +96,17 @@ def unified_message_handler(client: WebClient, event: Dict[str, Any], body: Dict
9496
9597 """
9698 event_id = gate_common (event = event , body = body )
99+ logger .debug ("logging result of gate_common" , extra = {"event_id" : event_id , "body" : body })
97100 if not event_id :
98101 return
102+ # if its in a group chat
103+ # and its a message
104+ # and its not in a thread
105+ # then ignore it as it will be handled as an app_mention event
106+ if not should_reply_to_message (event ):
107+ logger .debug ("Ignoring message in group chat not in a thread" , extra = {"event" : event })
108+ # ignore messages in group chats
109+ return
99110 user_id = event .get ("user" , "unknown" )
100111 conversation_key , _ = conversation_key_and_root (event = event )
101112 session_pull_request_id = extract_session_pull_request_id (conversation_key )
0 commit comments