Closed TheTharin closed 4 years ago
You can't, see https://api.slack.com/rtm.
_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 asuser set to true.
Use the web client that was used to obtain the RTM client and send messages with chat_postMessage
, https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/real_time/client.rb#L19.
Hi there! Wanted to ask for a propper way to add attachments or blocks to the
client.say
command. I tried plain hashes, JSON unencoded strings, URL-encoded JSON strings, - nothing works for me. Could you please provide an example? UPD: okay, I see that Slack RTM Api doesn't support message formatting currently, only ordinary WEB API. What are your suggestions then? Should I just use plain slack-ruby-client with my Rails app for that?