Slack threads and chat integration plugin transcripts

I’ve added basic support for threads to my other pending PR (changes the same bits of code):

Either syntax can be used:

/discourse post thread https://<slackname>


/discourse post

In both cases the “first/last message” UI is skipped - the entire thread is included in the transcript.


I think one option we would be open to is a pr that allows you to set which TL has particular blocked words, cause blocking thread from tl0 and 1 is pretty much our intent here, plus we want to make the feature better, and there are tons of missing refinements here that are missing, like teaching people why a word is blocked (optionally) vs just saying sorry, not allowed



Anything holding back this PR in particular? Or is it just the normal other things have been higher priority situation?

Eager to try it out!

1 Like

Sorry for the huge delay here. We stopped using Slack internally so testing changes like this is hard. PR is merged.


Hey @david - Just got a chance to try out the new feature to post threads… looks like it’s not quite working or us.

I tried each syntax or a couple different threads, but just get this in response:

Loading the transcript…

Using the normal command continues to work as it did before, though.

Also, when I tried posting a transcript from a private channel, I got this:

Darn - that slash command didn’t work (error message: 422_client_error). Manage the command at Discourse

I looked at the diff from the PR and thought perhaps it’d be necessary to add the conversations:history scope to the app on Slack, but I didn’t see that as an option. I tried adding the groups:history scope instead, but that did not seem to work.

Let me know if there’s anything else you’d like me to try for either of these issues. Thanks!

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?


I tried adding these scopes, and reinstalling:


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 Like

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

as did:

/discourse post thread

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


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 Like

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.


Slash commands now work in Slack Threads! See :point_down:t3:

Any chance we could see support for a slash command within a thread that posts a transcript? :crossed_fingers:t3:


I really want this to be true because it would make my life so much easier, but I don’t see anything about it in the Slack API documentation. I wonder if they gave giphy special alpha-testing access? Do you see documentation that I don’t?

More information, possibly: Today at work, one person in a thread complained about slack not allowing /giphy in threads and posted an image of slack telling them that it wasn’t supported in threads, and another person used /giphy successfully, in the same thread. Seems like there might be some A/B testing going on here.

1 Like

Good news! I just merged a change to the plugin which adds support for Slack’s “Shortcuts” API. Now you can hit the on a thread, click “Post to Discourse”, and you’ll be given a button which takes you straight to Discourse. No more fussing with slash commands or thread permalinks!

To get this working, you’ll need the latest version of the chat-integration, and you’ll need to modify your Slack app using this new step of the setup

As always, let us know if you have any feedback :slight_smile:

cc @mcwumbly @galligan @mcdanlj




I tried to add this functionality just now and unfortunately got an

Error: unable to fetch channel history from Slack

I tried this on our newest Slack message.

Have you followed all the setup instructions in this topic. In particular, have you given the bot all the necessary scopes?

I found the problem! Our Chat Integration App wasn’t in the channel I was trying to post from. After inviting the app to the channel, I was able to post a transcript. Thank you.

  • Is it possible to automatically add the Chat Integration App in every Slack channel automatically, now and in the case of any new channel created in the future?

  • Changing the “Continue on Discourse” button text to something more like “Create Transcript” or the Name of the shortcut (default “Post to Discourse” but changeable) would make sense from a UX perspective, given that not all Discourse sites call themselves Discourse


Unfortunately I don’t think so, but I’d love to be wrong on that. I will look into whether we can improve the error message here so it gives you instructions on how to add the bot to the channel.

:+1: good point. We can certainly update the default to remove the word ‘Discourse’. But in the meantime, you should be able to search for “Continue on Discourse” in the admin panel and change it to whatever you like: Customize all text in Discourse

Edit: default button text is now Continue on Forum


I followed all steps described in the Slack thread. I added all scopes described there (even added extra ones) and I invited the app to the relevant channels.

The problem is that for 1% of cases it seems to work, see here:

But 99% in public channels I’m getting the error: “Error: unable to fetch users from Slack”

And in DMs: “Error: unable to fetch channel history from Slack”

1 Like