我正在开发一个简单的 Slack Bot 以在任何渠道(私人、公共、bot dms)中发布。我正在使用 node.js、axios 和 chat.postMessage 松弛方法 ( https://api.slack.com/methods/chat.postMessage ) 在我的频道中发帖。该机器人非常适合我,但是当其他人将应用程序/机器人添加到他们的频道时,它不会为他们发布。测试用户也都在同一个工作区中。它仍然看到他们正在调用它,但是它没有为他们发布。
module.exports.result = function postMessage(message,ID){
axios.post(url,
JSON.stringify(message),
{headers:
{
'Content-type': contentType,
'Authorization': auth
}})
.then(function (response) {
console.log("status: " + response.status + " status test:" + response.statusText +" ");
return response.status;
})
.catch(function (error) {
console.log(error);
});
}