我已经设法使用Google Apps脚本(GAS)创建了一个简单的交互式按钮Slack应用程序.
我知道如何用响应来替换原始消息,但我想只更换按钮,如Slack Interactive Button文档中所示(但没有清楚解释)多个位置:https:
//api.slack.com/文档/消息按钮#crafting_your_message
我想做这里演示的内容:https: //a.slack-edge.com/dcb1/img/api/message_guidelines/Example_6.gif
这是原始邮件的更新,用相同的文本替换原始邮件但附件不同,......?
我当前的交互式按钮消息代码如下所示:
function sendMsgWithButton() {
// slack channel url (where to send the message)
var slackUrl = "https://hooks.slack.com/services/...";
// message text
var messageData = {
"text": "Here's your interactive buttons message.",
"attachments": [
{
"text": "Can you click the button?",
"fallback": "Sorry, no support for buttons.",
"callback_id": "ptNotificationButtonResponse",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [
{
"name": "userResponse",
"text": "OK",
"style": "primary",
"type": "button",
"value": "ok"
}
]
} …Run Code Online (Sandbox Code Playgroud) slack-api ×1