我正在使用botkit by howdy爲api調用postMessage方法。當我傳遞附件屬性時,它給我invalid_array_arg
錯誤。它獲取POST的方式有問題Slackbot附件 - 有什麼問題嗎?
bot.api.chat.postMessage(
{
channel : '#general',
text : 'hi',
parse : true,
username: '@' + bot.identity.name,
as_user : true,
icon_url: listOfMessages.logoUrl,
attachments: [{"pretext": "pre-hello", "text": "text-world"}]
}, function (err,res) {
if(err) console.log(err);
console.log(res);
}
);
來自Slack文檔的錯誤消息:'該方法傳遞了一個PHP風格的數組參數(例如,名稱爲foo [7])。這些從來都不適用於Slack API.' [Link](https://api.slack.com/methods/chat.postMessage) –