Skip to content

Commit b58b8bf

Browse files
committed
add to gcal button
1 parent eea86c0 commit b58b8bf

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

utils/slack.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,8 @@ def create_event(ack: Callable, body: dict[str, Any], client: WebClient):
4646
@app.action("propose-event")
4747
def create_event(ack: Callable, body: dict[str, Any], client: WebClient):
4848
handle_propose_event_btn(ack, body, client)
49+
50+
51+
@app.action("add-to-gcal")
52+
def add_to_gcal(ack: Callable):
53+
ack()

views/app_home.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ def get_home(user_id: str):
7676
"action_id": "more-info",
7777
}
7878
)
79+
buttons.append(
80+
{
81+
"type": "button",
82+
"text": {
83+
"type": "plain_text",
84+
"text": "Add to GCal",
85+
"emoji": True,
86+
},
87+
"url": event["fields"]["Calendar Link"],
88+
"action_id": "add-to-gcal",
89+
}
90+
)
7991
upcoming_events_blocks.append({"type": "actions", "elements": [*buttons]})
8092

8193
return {

0 commit comments

Comments
 (0)