CME*_*CME 6 slack-api slack slack-block-kit
我有一个使用下拉菜单的 Slack 机器人,它的侧面有一个颜色条。请参阅我在绿色圆圈中的屏幕截图
我希望该栏像此图片一样扩展整个消息
注意:此图像经过编辑以显示红色栏的示例(并且因为实际的松弛机器人消息并不重要)
我的代码有类似的东西
let slackPost = {
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": myText
}
} // ... some other blocks
],
"attachments": [
{
"text": menuTitle,
"color": menuBarColor,
"attachment_type": "default",
"actions": [
{
"name": menuName,
"text": menuPlaceHolder,
"type": "select",
"options": menuOptions
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
小智 7
您可以在附件属性内嵌套块,如下所示:
let slackPost = {
"attachments": [{
"color": message.color,
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": myText
}
} // ... some other blocks
]
}]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7936 次 |
最近记录: |