我试图用下面的代码更新模式,但它给我所有正确的输出。除了在顶部显示错误 We had some trouble connecting. Try again?
我找不到代码的任何问题。谁能帮帮我?
payload1 =json.loads(message_from_slack["payload"])
text = {
"type": "modal",
"callback_id": "modal-identifier",
"title": {
"type": "plain_text",
"text": "Just a modal"
},
"blocks": [
{
"type": "section",
"block_id": "section-identifier",
"text": {
"type": "mrkdwn",
"text": "*Welcome* to ~my~ Block Kit _modal_!"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "Just a button",
},
"action_id": "button-identifier",
}
}
],
}
return requests.post("https://slack.com/api/views.update", {
'token': "",
"view_id": payload1['view']['id'],
"hash": payload1['view']['hash'],
"view": str(text),
'statusCode': 200
}).json()