我正在使用howkit来为postMessage方法调用api.invalid_array_arg当我传递附件属性时,它给我错误.它获得POST的方式有问题
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);
}
);
Run Code Online (Sandbox Code Playgroud)
Tim*_*m B 16
我遇到了同样的问题并通过对数组进行字符串化来修复它.
attachments: JSON.stringify([{"pretext": "pre-hello", "text": "text-world"}])
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3385 次 |
| 最近记录: |