# Configurar notificações do Slack usando o plugin discourse-chat-integration

**URL:** https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730
**Category:** Integrations
**Tags:** chat-integration, how-to
**Created:** [24 Julho , 2017 16:45 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730 "2017-07-24T16:45:28Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![rkda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rkda/32/120046_2.png) [@rkda](https://meta.discourse.org/u/rkda)
#### Post date: [4 Abril , 2018 08:10 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/22 "2018-04-04T08:10:53Z")

</div>

Is this only limited to public channels or can it work with private Slack channels?

UPDATE: I got it to work by treating the private channels as public channels and prefixing its name with #. Slash commands still don’t work on private channels though.

---

<div class="post-metadata">

### Author: ![rkda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rkda/32/120046_2.png) [@rkda](https://meta.discourse.org/u/rkda)
#### Post date: [5 Abril , 2018 03:14 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/23 "2018-04-05T03:14:50Z")

</div>

I set up rules for private Slack channels using the Discourse interface and I can receive the post notifications just fine. However, I can’t use slash commands on those private channels. They work just fine on public channels. I was hoping to use `/discourse post` for the transcripts. Is this a bug?

---

<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: [5 Abril , 2018 09:37 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/24 "2018-04-05T09:37:47Z")

</div>

Yes, it sounds like a bug - I don’t think you are the only one with this problem.

---

<div class="post-metadata">

### Author: ![rkda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rkda/32/120046_2.png) [@rkda](https://meta.discourse.org/u/rkda)
#### Post date: [5 Abril , 2018 09:40 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/25 "2018-04-05T09:40:52Z")

</div>

Got it. I thought there was something wrong with my setup. I’m using the latest version of Discourse (v2.0.0.beta5+149).

---

<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: [5 Abril , 2018 19:33 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/26 "2018-04-05T19:33:28Z")

</div>

I’ve just created a PR to fix slash commands in private channels, and add support for transcripts in private channels and direct messages:

[https://github.com/discourse/discourse-chat-integration/pull/20](https://github.com/discourse/discourse-chat-integration/pull/20)

This will require adding two new ‘scopes’ to the slack app, which I’ve added to the #howto above:

- `groups:history`
- `im:history`

---

<div class="post-metadata">

### Author: ![rkda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rkda/32/120046_2.png) [@rkda](https://meta.discourse.org/u/rkda)
#### Post date: [7 Abril , 2018 14:20 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/27 "2018-04-07T14:20:20Z")

</div>

Awesome! Looking forward to testing it 🙂 We actually use [wisemonk](https://github.com/dgraph-io/wisemonk) on our Slack as well but we never could trigger it no matter how busy our channels get.

---

<div class="post-metadata">

### Author: ![rkda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rkda/32/120046_2.png) [@rkda](https://meta.discourse.org/u/rkda)
#### Post date: [26 Abril , 2018 07:54 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/28 "2018-04-26T07:54:03Z")

</div>

Just noticed that there’s a new version of the chat integration plugin but this fix isn’t included. Will this be merged anytime soon?

---

<div class="post-metadata">

### Author: ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)
#### Post date: [1 Maio , 2018 18:11 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/29 "2018-05-01T18:11:21Z")

</div>

From what I can tell on the settings, it doesn’t look like there’s a way to send a notifications as a slack PM… is that possible? Or does that need to be developed/implemented?

---

<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: [1 Maio , 2018 18:16 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/30 "2018-05-01T18:16:51Z")

</div>

You should be able to send notifications as a PM by specifying the channel name as something like `@jerdog`.

Slash commands do not currently work within private channels or private messages, but will do once this PR is merged by the team:

[https://github.com/discourse/discourse-chat-integration/pull/20](https://github.com/discourse/discourse-chat-integration/pull/20)

---

<div class="post-metadata">

### Author: ![HeroicEric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heroiceric/32/105979_2.png) [@HeroicEric](https://meta.discourse.org/u/HeroicEric)
#### Post date: [18 Maio , 2018 18:34 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/31 "2018-05-18T18:34:43Z")

</div>

Is there any way to configure this so that the messages posted in slack are posted by a Bot (other than slackbot)?

---

<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: [18 Maio , 2018 18:38 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/32 "2018-05-18T18:38:27Z")

</div>

Messages are posted by a bot. You can configure the name and picture of the bot in your slack app settings. Notifications look something like this:

 ![24](https://global.discourse-cdn.com/meta/original/3X/5/b/5bf118125493e5ea5118ca937223aa3ec7358c2d.png)

---

<div class="post-metadata">

### Author: ![HeroicEric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heroiceric/32/105979_2.png) [@HeroicEric](https://meta.discourse.org/u/HeroicEric)
#### Post date: [18 Maio , 2018 19:02 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/33 "2018-05-18T19:02:52Z")

</div>

Hmm, maybe this is just some kind of caching issue with Slack?

Our slack community is called “Envoy”. I can see the correct name when I click on “Envoy” there but ideally the message comes in appearing from “Discourse”.

 ![50%20AM](https://global.discourse-cdn.com/meta/original/3X/9/c/9c656901aba4fd5924bbf7501aa882aa09c85914.png)

I will wait a bit and see if it resolves itself.

---

<div class="post-metadata">

### Author: ![FrMatt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frmatt/32/119923_2.png) [@FrMatt](https://meta.discourse.org/u/FrMatt)
#### Post date: [29 Maio , 2018 16:43 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/34 "2018-05-29T16:43:21Z")

</div>

Hi all,

I’ve tried to add slack integration on my Discourse self-hosted app but I’m encountering an error when a new topic is created on a category … When I run a test on my channel rule, I get a “500 error” …

Here is the log I’ve received :  
`URI::InvalidURIError (can not set host with registry or opaque) /usr/local/lib/ruby/2.4.0/uri/generic.rb:592:in 'check_host'`

And here is an extract of the error backtrace :

```
/usr/local/lib/ruby/2.4.0/uri/generic.rb:592:in 'check_host'
/usr/local/lib/ruby/2.4.0/uri/generic.rb:636:in 'host='
/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message_formatter.rb:44:in 'absolute_url'
/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message_formatter.rb:21:in 'start_element'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.2/lib/nokogiri/html/sax/parser.rb:36:in 'parse_with' [...]

```

Has anyone ever had this error?

---

<div class="post-metadata">

### Author: ![Nick\_Shearer\_nsheare](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nick_shearer_nsheare/32/119547_2.png) [@Nick\_Shearer\_nsheare](https://meta.discourse.org/u/Nick_Shearer_nsheare)
#### Post date: [15 Agosto , 2018 16:51 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/35 "2018-08-15T16:51:00Z")

</div>

when i used the slash command from a private channel i.e  
`#my-special-channel` → `/discourse watch site-feedback`

the entry in the discourse plugins settings had the channel `#privategroup`

i.e

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

works fine if i go and edit the channel name, but this isn’t ideal for users who aren’t also discourse admins :-[

---

<div class="post-metadata">

### Author: ![Sakshi\_Gupta](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Sakshi\_Gupta](https://meta.discourse.org/u/Sakshi_Gupta)
#### Post date: [23 Agosto , 2018 16:58 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/36 "2018-08-23T16:58:14Z")

</div>

![04%20PM](https://global.discourse-cdn.com/meta/original/3X/7/d/7d681eff326cfa9aa64b562ea3f5f3fcdeb1cf98.png)

A few issues i have had -

- This gets posted in a channel with name as `sakshi`. Have I missed some configuration here ?
- slash commands aren’t working for me. The redirect urls that you have told above

/chat-integration/slack/interactive and command do not seem to be valid 😕

```
 curl -vL localhost/chat-integration/slack/command > /dev/null
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1...
* connect to ::1 port 80 failed: Connection refused
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /chat-integration/slack/command HTTP/1.1
> Host: localhost
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Thu, 23 Aug 2018 16:57:58 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< X-Request-Id: cf210d9f-4e18-465e-bec5-77f656095a3f
< X-Runtime: 0.027693
<
{ [4703 bytes data]
100 4695 0 4695 0 0 124k 0 --:--:-- --:--:-- --:--:-- 127k
* Connection #0 to host localhost left intact

```

---

<div class="post-metadata">

### Author: ![Sakshi\_Gupta](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Sakshi\_Gupta](https://meta.discourse.org/u/Sakshi_Gupta)
#### Post date: [24 Agosto , 2018 04:04 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/37 "2018-08-24T04:04:30Z")

</div>

Sorry, the issue was with our server, it is accessible only through our vpn. As slack could not contact the server it raised 503\_service\_error.

---

<div class="post-metadata">

### Author: ![Pooja08](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pooja08/32/133855_2.png) [@Pooja08](https://meta.discourse.org/u/Pooja08)
#### Post date: [13 Março , 2019 15:38 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/38 "2019-03-13T15:38:25Z")

</div>

when i use slash command on slack channel /discourse status i got error ‘Peer certificate cannot be authenticated with the given CA certificate’ . Kindle provide suggestions asap.

---

<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: [13 Março , 2019 16:39 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/39 "2019-03-13T16:39:54Z")

</div>

It sounds like Slack doesn’t like the SSL certificate of your Discourse server. Can you share your Discourse URL here?

---

<div class="post-metadata">

### Author: ![pihentagy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pihentagy/32/131067_2.png) [@pihentagy](https://meta.discourse.org/u/pihentagy)
#### Post date: [13 Março , 2019 20:48 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/40 "2019-03-13T20:48:46Z")

</div>

Hi!

I advertise Discourse using your plugin on our company Slack. 👍

However I noticed, that unlisted topics are also mentioned by the bot. Could you tweak it to not blurt those without explicit command?

And the same thoughts about not public categories.

Thanks

---

<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: [13 Março , 2019 23:19 UTC](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730/41 "2019-03-13T23:19:54Z")

</div>

Having an option to prevent posting of unlisted topics sounds like a good idea.

For private categories, you can already control that. See the “Security/Permissions” section of this topic: [Discourse Chat Integrations](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522)

[Página anterior](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730.md?page=1)

[Próxima página](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730.md?page=3)
