File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,39 @@ def handle_submission(ack, body):
2727
2828モーダルの送信について詳しくは、<a href =" https://api.slack.com/surfaces/modals/using#handling_submissions " >API ドキュメント</a >を参照してください。
2929
30+ ---
31+
32+ ##### Handling views on close
33+
34+ ` view_closed ` リクエストをリッスンするためには ` callback_id ` を指定して、かつ ` notify_on_close ` 属性をモーダルのビューに設定する必要があります。以下のコード例をご覧ください。
35+
36+ よく詳しい情報は、<a href =" https://api.slack.com/surfaces/modals/using#modal_cancellations " >API ドキュメント</a >を参照してください。
37+
38+ ``` python
39+ client.views_open(
40+ trigger_id = body.get(" trigger_id" ),
41+ view = {
42+ " type" : " modal" ,
43+ " callback_id" : " modal-id" , # view_closed の処理時に必要
44+ " title" : {
45+ " type" : " plain_text" ,
46+ " text" : " Modal title"
47+ },
48+ " blocks" : [],
49+ " close" : {
50+ " type" : " plain_text" ,
51+ " text" : " Cancel"
52+ },
53+ " notify_on_close" : True , # この属性は必須
54+ }
55+ )
56+ # view_closed リクエストを処理する
57+ @app.view_closed (" modal-id" )
58+ def handle_view_closed (ack , body , logger ):
59+ ack()
60+ logger.info(body)
61+ ```
62+
3063</div >
3164
3265<div >
You can’t perform that action at this time.
0 commit comments