【发布时间】:2020-08-12 17:39:19
【问题描述】:
我有一个简单的模式,使用以下方式推送视图:
const result = await bot.api.views.open({
trigger_id: message.trigger_id,
view: {
"type": "modal",
"submit": {
"type": "plain_text",
"text": "Submit",
"emoji": true
},
"title": {
"type": "plain_text",
"text": "Request",
"emoji": true
},
"blocks": [
{
"type": "input",
"block_id" : "accblock",
"element": {
"type": "plain_text_input",
"action_id": "account_name",
"multiline": false
},
"label": {
"type": "plain_text",
"text": "Account Name",
"emoji": true
}
}
]
}
});
如果在view_submission 上输入了某个值,我需要将错误添加到块中。我知道我应该使用以下 JSON 发送响应:
{
response_action: 'errors',
errors: {
"ticket-desc": 'I will never accept a value, you are doomed!'
}
}
但是,我该如何发送呢?我试过使用bot.httpBody()。这个 JSON 是否需要作为视图对象包含在内?任何帮助表示赞赏。
【问题讨论】:
-
非常感谢任何帮助
-
我如何用 Java 发送它?