Skip to content

Commit 30597c7

Browse files
committed
Checking for thread_ts and replying back in a thread
1 parent 0730680 commit 30597c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

solution/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,18 @@ async def echo(request: Request, response: Response, data=Body(...)):
3333

3434
event_type = payload.get("event.type")
3535
channel_id = payload.get("event.channel")
36+
thread_ts = payload.get("event.thread_ts")
3637

3738
if event_type == "app_mention":
3839
send_message_payload = {
3940
"channel": channel_id,
4041
"text": "Pinging back in the channel"
4142
}
4243

44+
if thread_ts is not None:
45+
send_message_payload["thread_ts"] = thread_ts
46+
send_message_payload["text"] = "Replying back in a thread"
47+
4348
headers = {
4449
"Authorization": f"Bearer {BOT_TOKEN}"
4550
}

0 commit comments

Comments
 (0)