-
[slack_bolt] app.event 또는 app.action에서 reply 하기Programing/Python 2024. 4. 15. 13:29
Reply 로 메세지를 생성하기 위해서는 아래와 같이 thread_ts 를 say로 전달해 주면 된다.
app.event
@app.event("message") def handle_message_events(body, event, say): say({ "channel": body["event"]["channel"], "text": "This is a threaded reply!", "thread_ts": body.get("thread_ts", body["event"]["ts"]), # Use thread_ts if available, otherwise use ts })
app.action
@app.action("action_id") def button_click(ack, body, say): # Acknowledge the action ack() say({ "channel": body['channel']['id'], "text": "This is a threaded reply!", "thread_ts": body.get("thread_ts", body["message"]["ts"]), # Use thread_ts if available, otherwise use ts })
'Programing > Python' 카테고리의 다른 글
[Python] SSL: CERTIFICATE_VERIFY_FAILED (0) 2023.06.12 주식 정보 크롤링 및 필터링 (0) 2023.03.03 [python] string to list (0) 2023.03.02 [Warning] Thread issue (OMP_NUM_THREADS=1) (0) 2023.03.02 [jupiter] Install package (0) 2023.02.06