Closed ghostsquad closed 9 years ago
The RTM API only supports posting simple messages formatted using our default message formatting mode. It does not support attachments or other message formatting modes. To post a more complex message as a user clients can call the chat.postMessage Web API method with as_user set to true.
HOWEVER! In the API there is a way to send requests using the Web API method. I added this to my commands switch.
case "debugpost":
var payload = {
"attachments": [
{
"fallback": "Fall back for notificaiton",
"pretext": "PRETEXT",
"title": "TITLE",
"title_link": "TITLE LINK",
"text": "woo! attachments",
"color": "#7CD197"
}
],
"username": "USERNAME",
"channel": data.channel,
"icon_url": "http://i.imgur.com/hAfHdi3.png"
};
slack.reqAPI('chat.postMessage', payload, function(data) {
// do stuff
});
break;
I hope this is what you wanted.
This is exactly what I was looking for. Thanks!
On Fri, Aug 28, 2015 at 2:12 PM xBytez notifications@github.com wrote:
Closed #24 https://github.com/xBytez/slackbotapi/issues/24.
— Reply to this email directly or view it on GitHub https://github.com/xBytez/slackbotapi/issues/24#event-395487630.
https://api.slack.com/docs/attachments