Slack API postMessage 阻止消息显示为字符串

问题描述

您好,我正在尝试使用 postMessage 向 slack 频道发送消息,我想使用块发送消息,但它不起作用。

我的邮件正文:

{ channel: 'alert',blocks:
   [ { type: 'header',text: [Object] },{ type: 'section',fields: [Array] },fields: [Array] } ] }

我如何使用 postMessage 发送:

bot.postMessage(sendobj.channel,blocks=sendobj.blocks);

输出

[{"type":"header","text":{"type":"plain_text","text":"Backup done!","emoji":true}},{"type":"section","fields":[{"type":"mrkdwn","text":"*File size:*812.0 B"},{"type":"mrkdwn","text":"Files:['jj','jj','hh']"}]},"text":"*When:*hh"}]}]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)