Skip to content

Commit 2cedd46

Browse files
authored
Merge pull request #117 from aaron-suarez/add-value-to-dialog
Add value to dialog
2 parents 17d9db3 + 1b923fa commit 2cedd46

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

pybot/endpoints/slack/actions/mentor_request.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ async def mentor_details_submit(action: Action, app: SirBot):
5353

5454

5555
async def open_details_dialog(action: Action, app: SirBot):
56+
request = MentorRequest(action)
57+
cur_details = request.details
5658
trigger_id = action["trigger_id"]
57-
response = {"trigger_id": trigger_id, "dialog": mentor_details_dialog(action)}
59+
response = {"trigger_id": trigger_id, "dialog": mentor_details_dialog(action, cur_details)}
5860
await app.plugins["slack"].api.query(methods.DIALOG_OPEN, response)
5961

6062

pybot/endpoints/slack/utils/action_messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def build_report_message(slack_id, details, message_details):
252252
return {"text": message, "channel": MODERATOR_CHANNEL, "attachments": attachment}
253253

254254

255-
def mentor_details_dialog(action):
255+
def mentor_details_dialog(action, cur_details):
256256
trigger_id = action["trigger_id"]
257257
ts = action["message"]["ts"]
258258

@@ -269,6 +269,7 @@ def mentor_details_dialog(action):
269269
"name": "details",
270270
"placeholder": "",
271271
"required": False,
272+
"value": cur_details
272273
}
273274
],
274275
}

0 commit comments

Comments
 (0)