如何让SLACK API BLOCK套件占据整个SLACK窗口的宽度? [英] How to make slack api block kit take up the entire width of the slack window?

查看:0
本文介绍了如何让SLACK API BLOCK套件占据整个SLACK窗口的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一些自动通知创建一个Slackbot,我收到了一个请求,要让通知占据整个松弛窗口的宽度,这样看起来干净多了。我发现似乎有一个特定的宽度,积木似乎占据,并不会水平延伸超过该点。我想知道是否有解决办法来删除似乎正在发生的最大宽度

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

Ideally it would end up looking like this

我使用类似以下内容作为格式化块:

{
    "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"
    }
}

这是数据块工具包/SLACK API的限制吗?或者有什么方法可以取消此宽度限制吗?

Block Kit Builder site if anyone wants to play with formatting

推荐答案

松弛似乎有一种称为rich_text的块类型,该类型没有特别详细的文档记录,它确实填满了松弛消息面板的宽度。

{
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_preformatted",
          "elements": [
            {
              "type": "text",
              "text": "+---------+---------+---------+---------+---------+---------+---------+---------+

| column1 | column2 | column3 | column4 | column5 | column6 | column7 | column8 |

+---------+---------+---------+---------+---------+---------+---------+---------+

| row1c1  | row1c2  | row1c3  | row1c4  | row1c5  | row1c6  | row1c7  | row1c8  |

+---------+---------+---------+---------+---------+---------+---------+---------+"
            }
          ]
        }
      ]
    }
  ]
}

这篇关于如何让SLACK API BLOCK套件占据整个SLACK窗口的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆