gpt4 book ai didi

node.js - Slack 支持使用 Markdown 进行格式化吗?

转载 作者:太空宇宙 更新时间:2023-11-04 01:30:47 25 4
gpt4 key购买 nike

我在 Slack 中看到了这个:

enter image description here

我的 Node.js 代码如下所示:

  const messageText = `

## Jenkins build started

## Build status: ${b.state}

#### Repo: ${b.repo_name || 'unknown repo'}

Raw data:
\`\`\`
${JSON.stringify(b)}
\`\`\`

`;

// "type": "mrkdwn",


return webClient.chat.postMessage({channel: id, text: messageText, mrkdwn: true}).then(res => {
console.log('Message sent: ', res.ts);
});

显然 slack 正在收到请求,只是格式不符合我的预期,有人知道如何在 Slack 上很好地格式化 markdown 吗?

最佳答案

Slack 不支持 Markdown,但有自己的标记语言。

示例:

_italic_ will produce italicized text
*bold* will produce bold text
~strike~ will produce strikethrough text

无法生成标题。

查看官方文档here有关所有选项的完整说明。

关于node.js - Slack 支持使用 Markdown 进行格式化吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56204314/

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