Spaces:
Sleeping
Sleeping
Atharva Chauthaiwale
commited on
Commit
·
70657af
1
Parent(s):
720bad9
block kit processing
Browse files
app.py
CHANGED
@@ -13,6 +13,7 @@ app = App(
|
|
13 |
signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
|
14 |
)
|
15 |
|
|
|
16 |
@app.command("/get-case-digest")
|
17 |
def get_case_digest(ack, respond, command):
|
18 |
# Acknowledge command request
|
@@ -62,10 +63,20 @@ def get_case_digest(ack, respond, command):
|
|
62 |
|
63 |
|
64 |
@app.action("summarize_case")
|
65 |
-
def update_message(ack, action,
|
66 |
-
logging.info(f"received action payload {action}")
|
67 |
-
logging.info(f"Case retrieved {SimpleKVStore.get(action['value'])}")
|
68 |
ack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
# Start your app
|
71 |
if __name__ == "__main__":
|
|
|
13 |
signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
|
14 |
)
|
15 |
|
16 |
+
|
17 |
@app.command("/get-case-digest")
|
18 |
def get_case_digest(ack, respond, command):
|
19 |
# Acknowledge command request
|
|
|
63 |
|
64 |
|
65 |
@app.action("summarize_case")
|
66 |
+
def update_message(ack, action, respond):
|
|
|
|
|
67 |
ack()
|
68 |
+
case = SimpleKVStore.get(action['value'])
|
69 |
+
logging.info(f"Case retrieved {case}")
|
70 |
+
blocks = [
|
71 |
+
{
|
72 |
+
"type": "section",
|
73 |
+
"text": {
|
74 |
+
"type": "mrkdwn",
|
75 |
+
"text": f"*<{case['link']}| {case['title']}>*\n*Diary no*: {case['diary_no']}"
|
76 |
+
}
|
77 |
+
},
|
78 |
+
]
|
79 |
+
respond(blocks=blocks)
|
80 |
|
81 |
# Start your app
|
82 |
if __name__ == "__main__":
|