Skip to content

Commit e890220

Browse files
committed
fix: only add 👀 reaction on first message
1 parent b2fd69f commit e890220

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

listeners/events/app_mentioned.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ def handle_app_mentioned(client: WebClient, event: dict, logger: Logger, say: Sa
3939
)
4040
return
4141

42-
# Add eyes reaction
43-
client.reactions_add(
44-
channel=channel_id,
45-
timestamp=event["ts"],
46-
name="eyes",
47-
)
42+
# Add eyes reaction only to the first message (not threaded replies)
43+
if not event.get("thread_ts"):
44+
client.reactions_add(
45+
channel=channel_id,
46+
timestamp=event["ts"],
47+
name="eyes",
48+
)
4849

4950
# Get conversation history
5051
history = conversation_store.get_history(channel_id, thread_ts)

listeners/events/message_im.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ def handle_message_im(client: WebClient, event: dict, logger: Logger, say: Say):
3636
thread_ts = event.get("thread_ts") or event["ts"]
3737
user_id = event["user"]
3838

39-
# Add eyes reaction
40-
client.reactions_add(
41-
channel=channel_id,
42-
timestamp=event["ts"],
43-
name="eyes",
44-
)
39+
# Add eyes reaction only to the first message (not threaded replies)
40+
if not event.get("thread_ts"):
41+
client.reactions_add(
42+
channel=channel_id,
43+
timestamp=event["ts"],
44+
name="eyes",
45+
)
4546

4647
# Get conversation history
4748
history = conversation_store.get_history(channel_id, thread_ts)

0 commit comments

Comments
 (0)