gpt4 book ai didi

slack-api - 如何让 slack api block kit 占据整个 slack 窗口的宽度?

转载 作者:行者123 更新时间:2023-12-03 15:14:18 28 4
gpt4 key购买 nike

我正在为一些自动通知创建一个 slackbot,并且我收到了一个请求,让通知占据整个 slack 窗口的宽度,这看起来更干净。我发现 block 似乎占据了一个指定的宽度,并且不会水平延伸超过该点。我想知道是否有解决方法来删除似乎正在发生的最大宽度

Current implementation: Seems to have a maximum width that isn't specified

Ideally it would end up looking like this

我使用这样的东西作为我的格式化 block :

{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Testing if a longer message will force the update box to be wider Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "Button",
"emoji": true
},
"value": "click_me_123"
}
}

这是 block kit/slack api 的限制吗?或者有没有办法消除这个宽度限制?

Block Kit Builder site if anyone wants to play with formatting

最佳答案

Slack 似乎有一种没有特别详细记录的 block 类型,称为 rich_text。这确实填充了 Slack 消息面板的宽度。

{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_preformatted",
"elements": [
{
"type": "text",
"text": "+---------+---------+---------+---------+---------+---------+---------+---------+\n
| column1 | column2 | column3 | column4 | column5 | column6 | column7 | column8 |\n
+---------+---------+---------+---------+---------+---------+---------+---------+\n
| row1c1 | row1c2 | row1c3 | row1c4 | row1c5 | row1c6 | row1c7 | row1c8 |\n
+---------+---------+---------+---------+---------+---------+---------+---------+"
}
]
}
]
}
]
}

关于slack-api - 如何让 slack api block kit 占据整个 slack 窗口的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57438097/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com