# Slack threads and chat integration plugin transcripts

**URL:** https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909
**Category:** Feature
**Tags:** chat-integration
**Created:** [October 12, 2017, 4:57am UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909 "2017-10-12T04:57:39Z")
**Posts on this page:** 14
**Page:** 2

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 18, 2018, 12:33pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/21 "2018-05-18T12:33:34Z")

</div>

> [@mcwumbly](#):
>
> 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.

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?

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [May 18, 2018, 2:04pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/22 "2018-05-18T14:04:29Z")

</div>

I tried adding these scopes, and reinstalling:

```plaintext
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).

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [June 25, 2018, 2:37pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/23 "2018-06-25T14:37:59Z")

</div>

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!

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

```

as did:

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

```

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

---

<div class="post-metadata">

### Author: ![tony612](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tony612/32/111913_2.png) [@tony612](https://meta.discourse.org/u/tony612)
#### Post date: [September 26, 2018, 6:49am UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/24 "2018-09-26T06:49:41Z")

</div>

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

```plaintext
{
	"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
}

```

---

<div class="post-metadata">

### Author: ![mbugowski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbugowski/32/124403_2.png) [@mbugowski](https://meta.discourse.org/u/mbugowski)
#### Post date: [November 9, 2018, 2:24pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/26 "2018-11-09T14:24:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [January 4, 2019, 1:52pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/27 "2019-01-04T13:52:33Z")

</div>

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

[https://github.com/discourse/discourse-chat-integration/commit/1a08d647857b356bdd39810bde76bc90de978337](https://github.com/discourse/discourse-chat-integration/commit/1a08d647857b356bdd39810bde76bc90de978337)

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

---

<div class="post-metadata">

### Author: ![galligan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/galligan/32/224839_2.png) [@galligan](https://meta.discourse.org/u/galligan)
#### Post date: [July 31, 2020, 3:25pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/28 "2020-07-31T15:25:29Z")

</div>

> [@david](#):
>
> Unfortunately Slack still don’t support custom slash commands in threads, so we’re stuck with performing the slash commands in the context of the main channel ☹

Slash commands now work in Slack Threads! See 👇🏼

 ![CleanShot 2020-07-31 at 11.23.36@2x](https://global.discourse-cdn.com/meta/original/3X/9/a/9aed68307286825ec4491d02671947b65923a420.png)

Any chance we could see support for a slash command within a thread that posts a transcript? 🤞🏼

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [August 24, 2020, 5:55pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/29 "2020-08-24T17:55:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 22, 2021, 5:57pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/30 "2021-04-22T17:57:36Z")

</div>

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!

[https://github.com/discourse/discourse-chat-integration/commit/610364ff6d9adbd642c9d201415bbd6da795a036](https://github.com/discourse/discourse-chat-integration/commit/610364ff6d9adbd642c9d201415bbd6da795a036)

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/8/f8c4d8428ffa742096fd37306ed0b7e99bce0e09.jpeg) ![image](https://global.discourse-cdn.com/meta/original/3X/6/d/6d03c2e131ef2bff9208b4a6b5a8e93ca9e4a4e5.png)

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

> [@Set up Slack notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/1):
>
> 1. 🆕 Go to the Interactivity & Shortcuts page, click Create new Shortcut, choose “On messages”, and click Next. Enter these details:

As always, let us know if you have any feedback 🙂

cc @mcwumbly @galligan @mcdanlj

---

<div class="post-metadata">

### Author: ![debryc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/debryc/32/101652_2.png) [@debryc](https://meta.discourse.org/u/debryc)
#### Post date: [April 22, 2021, 7:17pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/31 "2021-04-22T19:17:57Z")

</div>

🤩🤩🤩

Incredible!

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.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 22, 2021, 7:26pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/32 "2021-04-22T19:26:14Z")

</div>

Have you followed all the setup instructions in [this topic](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730). In particular, have you given the bot all the necessary scopes?

> [@Set up Slack notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/1):
>
> ### For slash commands and transcript posting (If you don’t need this, skip this block)
> 
> 1. Add the following scopes under “Scopes / Bot Token Scopes”
> 
> - `users:read`
> - `channels:history`
> - `groups:history`
> - `im:history`

---

<div class="post-metadata">

### Author: ![debryc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/debryc/32/101652_2.png) [@debryc](https://meta.discourse.org/u/debryc)
#### Post date: [April 22, 2021, 7:40pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/33 "2021-04-22T19:40:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 22, 2021, 7:48pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/34 "2021-04-22T19:48:15Z")

</div>

> [@debryc](#):
>
> 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?

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.

> [@debryc](#):
>
> not all Discourse sites call themselves Discourse

👍 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 text in Discourse](https://meta.discourse.org/t/customize-all-text-in-discourse/36092)

Edit: default button text is now Continue on Forum

---

<div class="post-metadata">

### Author: ![Anna\_Geller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anna_geller/32/247418_2.png) [@Anna\_Geller](https://meta.discourse.org/u/Anna_Geller)
#### Post date: [February 2, 2022, 6:28pm UTC](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909/35 "2022-02-02T18:28:52Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/a/aa8cebf352b23e0be6d206f84cb998daafcd029d.png)

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

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/9/d9fa4032e4d609a123a0f86ff42027b50ae07523.png)

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

[Previous page](https://meta.discourse.org/t/slack-threads-and-chat-integration-plugin-transcripts/71909.md?page=1)
