# Set up Telegram integration using the discourse-chat-integration plugin

**URL:** https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603
**Category:** Integrations
**Tags:** chat-integration, how-to
**Created:** [July 21, 2017, 4:26pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603 "2017-07-21T16:26:57Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)
#### Post date: [April 26, 2019, 8:44am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/22 "2019-04-26T08:44:38Z")

</div>

> [@BobbyZopfan](#):
>
> I’ve configured everything successfully, except that whenever a new member leaves/adds into the telegram group which has the ‘chat integration bot’ as one of this groups member, I receive this msg in the telegram group:

Solved: Exited the chat bot from that telegram group. And understood that if I wanted the bot to be the part of that group, then that group’s chat ID need to have a channel and a channel rule under itself.

---

<div class="post-metadata">

### Author: ![Blumiere](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blumiere/32/140031_2.png) [@Blumiere](https://meta.discourse.org/u/Blumiere)
#### Post date: [May 9, 2019, 1:44pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/23 "2019-05-09T13:44:03Z")

</div>

The Telegram integration works very well for channels but it’s unsuitable for groups-- it will spam its operation instructions every time a chat “event” happens (like someone joining or leaving the chat, or a message getting pinned). Even if you disable the slash commands entirely. Is there a way to get the bot to not respond to these events?

---

<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 9, 2019, 2:01pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/24 "2019-05-09T14:01:41Z")

</div>

Do you have `group_privacy` disabled?

> [@david](#):
>
> You should leave “Group Privacy” enabled, otherwise the bot will try and respond to every single message in a group chat.

---

<div class="post-metadata">

### Author: ![Blumiere](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blumiere/32/140031_2.png) [@Blumiere](https://meta.discourse.org/u/Blumiere)
#### Post date: [May 9, 2019, 5:57pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/25 "2019-05-09T17:57:12Z")

</div>

I tried that setting too and saw that it becomes every message as you say. Even with `group_privacy` enabled bots can still see these join/leave/pin events.

---

<div class="post-metadata">

### Author: ![jucajuca](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jucajuca](https://meta.discourse.org/u/jucajuca)
#### Post date: [June 14, 2019, 8:25am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/26 "2019-06-14T08:25:01Z")

</div>

Hi,  
I created the telegram bot, entered the key and activated the function in discourse. HTTPS is enabled (our site runs behind an apache proxy)  
However the tab is not showing. Where can I debug this? I can not find any errors in the logs.  
Is there a way to test the connection to telegram from inside the Discourse container?  
thx

---

<div class="post-metadata">

### Author: ![jucajuca](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jucajuca](https://meta.discourse.org/u/jucajuca)
#### Post date: [June 16, 2019, 5:54pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/27 "2019-06-16T17:54:49Z")

</div>

short update on this. I entered the discourse container with `docker exec -it container /bin/bash`. then I executed the following:

`curl https://api.telegram.org/bot123456789:ABCDEfgh2ZojwyChMz0xuIo2Wvg4ww3XGI4g/getMe`

this returned an ok response with the name of my bot etc.

however the integration with discourse does not work yet. Is there a log file somewhere so that I can debug this? Any help is appreciated.

---

<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: [June 17, 2019, 1:08pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/28 "2019-06-17T13:08:18Z")

</div>

Is the `force_https` site setting enabled? Is the `chat_integration_enable_telegram` setting enabled?

---

<div class="post-metadata">

### Author: ![jucajuca](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jucajuca](https://meta.discourse.org/u/jucajuca)
#### Post date: [June 17, 2019, 1:53pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/29 "2019-06-17T13:53:02Z")

</div>

Hi,  
yes both settings are enabled.  
HTTPS is working fine, also with login integration with fb, google, tw.

what could be the cause, or where could I find the logs?

thx

---

<div class="post-metadata">

### Author: ![Surendra-Patil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/surendra-patil/32/147391_2.png) [@Surendra-Patil](https://meta.discourse.org/u/Surendra-Patil)
#### Post date: [June 20, 2019, 10:32am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/30 "2019-06-20T10:32:27Z")

</div>

@jucajuca

I am also facing same issue since last 4-5 days on my new discourse instance.

Hi @david, is there any way i can see the logs.

On my old instance notifications are working good with telegram bot, but in newer instance Chat ID is not getting generated. The curl command mentioned above is giving output as true from discourse instance. Other oauth plugins like google. twitter are working without any issues.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![codatory](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codatory/32/8386_2.png) [@codatory](https://meta.discourse.org/u/codatory)
#### Post date: [June 21, 2019, 1:02am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/31 "2019-06-21T01:02:30Z")

</div>

I just got it working on a new Discourse install by firing up `rails c` and manually running `DiscourseChat::Provider::TelegramProvider.setup_webhook()`

Hope that helps!

---

<div class="post-metadata">

### Author: ![Surendra-Patil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/surendra-patil/32/147391_2.png) [@Surendra-Patil](https://meta.discourse.org/u/Surendra-Patil)
#### Post date: [June 21, 2019, 6:17am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/32 "2019-06-21T06:17:12Z")

</div>

Thanks a lot @codatory  
@codinghorror Thanks for this awesome platform 🙂

It worked 👍

---

<div class="post-metadata">

### Author: ![jucajuca](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jucajuca](https://meta.discourse.org/u/jucajuca)
#### Post date: [June 22, 2019, 11:21am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/34 "2019-06-22T11:21:01Z")

</div>

> [@codatory](#):
>
> firing up `rails c` and manually running `DiscourseChat::Provider::TelegramProvider.setup_webhook()`

can you elaborate a bit on this? should I run these commands from within the container? in which directory? I’m not a rails expert. thx! : )

---

<div class="post-metadata">

### Author: ![codatory](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codatory/32/8386_2.png) [@codatory](https://meta.discourse.org/u/codatory)
#### Post date: [June 22, 2019, 1:40pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/35 "2019-06-22T13:40:47Z")

</div>

Yeah; so you enter the container and run  
`rails c`  
Then wait a bit for it to load up. Once it’s loaded up you can paste in  
`DiscourseChat::Provider::TelegramProvider.setup_webhook(); exit`  
Then you can exit out of the container and it _should_ be working.

---

<div class="post-metadata">

### Author: ![Ben\_Czegeny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ben_czegeny/32/147228_2.png) [@Ben\_Czegeny](https://meta.discourse.org/u/Ben_Czegeny)
#### Post date: [June 24, 2019, 4:35am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/36 "2019-06-24T04:35:09Z")

</div>

> [@codatory](#):
>
> DiscourseChat::Provider::TelegramProvider.setup\_webhook(); exit

THANK YOU, this solved my issue But had to toggle the plugin off in my admin. Then on. Then run this.

---

<div class="post-metadata">

### Author: ![Ben\_Czegeny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ben_czegeny/32/147228_2.png) [@Ben\_Czegeny](https://meta.discourse.org/u/Ben_Czegeny)
#### Post date: [July 16, 2019, 10:17pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/37 "2019-07-16T22:17:15Z")

</div>

I have been able to get this working but not in a group. It will send me notifications directly as a chat between myself and the bot.

I have added the bot to a private group, the bot had admin access in the group. And I have added the group as a channel in the discourse plugin settings. But whenever I try and send a test notification to the group(telegram channel) it gives me the 422 error. Not matter what I do. This error is from within the discourse telegram plugin channel settings.

Can someone help really want to get this setup for our group.

---

<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: [August 2, 2019, 9:08am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/38 "2019-08-02T09:08:00Z")

</div>

> [@codatory](#):
>
> I just got it working on a new Discourse install by firing up `rails c` and manually running `DiscourseChat::Provider::TelegramProvider.setup_webhook()`

This issue should now be resolved, thanks to this PR:

[https://github.com/discourse/discourse-chat-integration/commit/0b85c2a0e54e52fbacda6a470553196dec57a0db](https://github.com/discourse/discourse-chat-integration/commit/0b85c2a0e54e52fbacda6a470553196dec57a0db)

> [@Ben\_Czegeny](#):
>
> gives me the 422 error

The most common issue is an invalid API key. Make sure you copy/pasted it correctly, and haven’t introduced any spaces before/after by accident.

---

<div class="post-metadata">

### Author: ![Ben\_Czegeny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ben_czegeny/32/147228_2.png) [@Ben\_Czegeny](https://meta.discourse.org/u/Ben_Czegeny)
#### Post date: [August 4, 2019, 3:38pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/39 "2019-08-04T15:38:31Z")

</div>

API token is working correctly, I can receive the notifications in a private message from the bot on telegram. It just cannot send to the group. Also everytime someone in the channel sends a message, the bot says “This channel is setup with chatID: …” very annoying

---

<div class="post-metadata">

### Author: ![Surendra-Patil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/surendra-patil/32/147391_2.png) [@Surendra-Patil](https://meta.discourse.org/u/Surendra-Patil)
#### Post date: [October 31, 2019, 12:02pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/40 "2019-10-31T12:02:16Z")

</div>

> [@codatory](#):
>
> DiscourseChat::Provider::TelegramProvider.setup\_webhook()

Now I am getting this error.

Errno::ECONNRESET: Connection reset by peer - SSL\_connect  
from /usr/local/lib/ruby/2.6.0/net/protocol.rb:44:in `connect\_nonblock’

---

<div class="post-metadata">

### Author: ![Patrick\_Rawson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrick_rawson/32/160336_2.png) [@Patrick\_Rawson](https://meta.discourse.org/u/Patrick_Rawson)
#### Post date: [November 5, 2019, 12:53pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/41 "2019-11-05T12:53:07Z")

</div>

> [@Blumiere](#):
>
> I tried that setting too and saw that it becomes every message as you say. Even with `group_privacy` enabled bots can still see these join/leave/pin events.

No matter how this is toggled I’m experiencing the same issue. Is there a workaround here?

---

<div class="post-metadata">

### Author: ![kuba-orlik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuba-orlik/32/318490_2.png) [@kuba-orlik](https://meta.discourse.org/u/kuba-orlik)
#### Post date: [December 16, 2019, 9:13am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/42 "2019-12-16T09:13:01Z")

</div>

I’m trying to set up the notifications, but when I add the bot to the Telegram group, it does not send the chat ID. I’ve tried it multiple times and failed every time :\<

What can I do to troubleshoot it? I’ve already tried running the rails console command

[Previous page](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603.md?page=1)

[Next page](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603.md?page=3)
