Slack threads and chat integration plugin transcripts

For ‘Private Channels’ you need to add the groups:history scope. For “Direct Messages” you need to add the im:history scope. You will need to ‘reinstall’ the app for changes to scopes to take effect (Slack’s UI should have prompted you to do this).

Are you seeing anything at /logs when the errors occur?

「いいね!」 2

I tried adding these scopes, and reinstalling:

groups:history
im:history
mpim:history

Still getting that 422, but don’t see anything obvious in the Discourse logs in the admin panel (this is a hosted instance, so I don’t have direct access to other logs).

「いいね!」 1

I used the /discourse post command from a public channel to great effect… but threads are now more common in many channels than main channel conversations, so still hopeful that some day this will work in a thread…

Update: w00t! just tried it again and it worked!

/discourse post https://ourdomain.slack.com/archives/C0591LA4X/p1529529151000359?thread_ts=1529528304.000177&cid=C0592LA4X

as did:

/discourse post thread https://ourdomain.slack.com/archives/C0592LA4X/p1529528304000177

Another update: I was also able to post a thread from a private channel. :tada:

「いいね!」 9

I got an error when using post transcript in a public channel:

{
	"message": "Job exception: undefined method `[]' for nil:NilClass\n",
	"progname": null,
	"severity": 3,
	"backtrace": "/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:38:in `block in text'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:30:in `gsub'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:30:in `text'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:62:in `processed_text_with_attachments'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_transcript.rb:155:in `block in build_slack_ui'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_transcript.rb:155:in `map'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_transcript.rb:155:in `build_slack_ui'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_command_controller.rb:95:in `block in process_post_request'\n/var/www/discourse/lib/scheduler/defer.rb:70:in `block in do_work'\n/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'\n/var/www/discourse/lib/scheduler/defer.rb:68:in `do_work'\n/var/www/discourse/lib/scheduler/defer.rb:59:in `block (2 levels) in start_thread'",
	"count": 9,
	"env": {
		"message": "Running deferred code 'Processing slack transcript request'"
	},
	"protected": false
}
「いいね!」 1

Hello, did you managed to fix this? I have the same one.

To close the loop here - @mbugowski kindly contributed a pull request to fix the issue:

@tony612 if you update to the latest version it should now work.

「いいね!」 5

Slack のスレッド内でもスラッシュコマンドが動作するようになりました!詳しくは👇🏼をご覧ください。

スレッド内でトランスクリプトを投稿するスラッシュコマンドのサポートが実現する可能性はあるでしょうか?:crossed_fingers:t3:

「いいね!」 6

これが本当だと本当に願っています。そうすれば私の生活がずっと楽になるからです。しかし、Slack の API ドキュメントにはそのような記載が見当たりません。Giphy だけが特別なアルファテストアクセスを与えられたのでしょうか?私が見落としているドキュメントがありますか?

おそらく関連する追加情報として:今日、職場のあるスレッドで、1 人が「Slack がスレッド内での /giphy コマンドを許可していない」と不満を漏らし、Slack が「スレッド内ではサポートされていない」と表示している画像を投稿しました。一方、同じスレッド内で別の人が /giphy を正常に使用していました。ここには何らかの A/B テストが行われているようです。

「いいね!」 1

いい知らせです!プラグインに変更をマージし、Slack の「ショートカット」API へのサポートを追加しました。これでスレッド内の \u003ckbd\u003e…\u003c/kbd\u003e をクリックし、「Discourse に投稿」を選択すると、Discourse に直接移動できるボタンが表示されます。スラッシュコマンドやスレッドの永続的リンクに煩わされる必要はもうありません!

これを機能させるには、最新の chat-integration バージョンが必要で、さらに Slack アプリの設定を以下の新しい手順で変更する必要があります。

いつも通り、ご意見やフィードバックがあればお知らせください :slight_smile:

cc @mcwumbly @galligan @mcdanlj

「いいね!」 9

:star_struck::star_struck::star_struck:

すごい!

今すぐこの機能を追加しようと試みたのですが、残念ながら以下のエラーが発生しました。

Error: unable to fetch channel history from Slack

これは最新の Slack メッセージで試しました。

このトピックに記載されているセットアップ手順をすべて実行しましたか?特に、ボットに必要なすべてのスコープを付与しましたか?

問題を見つけました!チャット統合アプリが、投稿しようとしていたチャンネルに存在しませんでした。アプリをチャンネルに招待したところ、トランスクリプトを投稿できるようになりました。ありがとうございます。

  • 現在および今後作成されるすべての Slack チャンネルに、チャット統合アプリを自動的に追加することは可能でしょうか?

  • 「Discourse で続ける」ボタンのテキストを、「トランスクリプトを作成」やショートカットの名前(デフォルトは「Discourse に投稿」ですが変更可能)のような表現に変更することは、UX の観点から理にかなっています。すべての Discourse サイトが自分たちを「Discourse」と呼んでいるわけではないためです。

「いいね!」 2

残念ながら、それはできないと思います。ただし、私の認識が間違っている可能性もあります。エラーメッセージを改善して、ボットをチャンネルに追加する方法に関する手順を示せるか確認いたします。

:+1: なるほど、ご指摘ありがとうございます。デフォルトから「Discourse」という単語を削除するように更新することは可能です。それまでの間、管理パネルで「Continue on Discourse」を検索し、お好みの文言に変更することができます:Customize text in Discourse

編集:デフォルトのボタンテキストは現在、フォーラムに移動となっています。

「いいね!」 4

Slack スレッドに記載されているすべての手順を実行しました。そこに記載されているすべてのスコープを追加し (さらに追加したものもあります)、関連するチャンネルにアプリを招待しました。

問題は、1% のケースでは機能するように見えることです。こちらをご覧ください。

しかし、公開チャンネルの 99% では、「Error: unable to fetch users from Slack」というエラーが発生します。

DM では、「Error: unable to fetch channel history from Slack」というエラーが発生します。

「いいね!」 1