Unclear support for `markdown_text` option.

オープン
#579 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
ruby
領域
api

調査の方向性

Start at lib/slack/web/api/endpoints/chat.rb around line 196 and inspect the chat_postMessage argument handling alongside the linked Slack API reference. Reproduce the requests with markdown_text alone and with both markdown_text and text; done means the client behavior and documented Slack constraints agree, with the resulting behavior covered or clearly documented.

索引モデルが issue の本文から書いたものです。

説明

bug?

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.

https://github.com/slack-ruby/slack-ruby-client/blob/adfde852d1a40aaa05fc976164897ce83e0812d0/lib/slack/web/api/endpoints/chat.rb#L196

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.

主要言語
Ruby
スター
1.3k
フォーク
222
平均マージ
1日 14時間
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

slack-ruby/slack-ruby-client のほかの issue

slack-ruby/slack-ruby-client の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。