I was attempting to send markdown_text ref to the chat_postMessage but am encountering some issues.
The reference docs indicate that when passing markdown_text, text should be omitted:
Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.
If I do so, eg. .chat_postMessage({ markdown_text: "*Hello*"}), an ArgumentError is raised as I haven't passed text.
|
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? |
If I pass text and markdown_text, eg. .chat_postMessage({ markdown_text: "*Hello*", text: "*Hello*", mrkdwn: false}), the request goes through to the API but then fails with a Slack::Web::Api::Errors::MarkdownTextConflict error.
I believe the current workaround is to use Slack::Messages::Formatting.markdown or some other conversion process.
Is this an intentional gap in the API? Happy to raise a PR to amend if not.
I was attempting to send
markdown_textref to thechat_postMessagebut am encountering some issues.The reference docs indicate that when passing
markdown_text,textshould be omitted:If I do so, eg.
.chat_postMessage({ markdown_text: "*Hello*"}), anArgumentErroris raised as I haven't passedtext.slack-ruby-client/lib/slack/web/api/endpoints/chat.rb
Line 196 in adfde85
If I pass
textandmarkdown_text, eg..chat_postMessage({ markdown_text: "*Hello*", text: "*Hello*", mrkdwn: false}), the request goes through to the API but then fails with aSlack::Web::Api::Errors::MarkdownTextConflicterror.I believe the current workaround is to use
Slack::Messages::Formatting.markdownor some other conversion process.Is this an intentional gap in the API? Happy to raise a PR to amend if not.