# 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:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [July 21, 2017, 4:26pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/1 "2017-07-21T16:26:57Z")

</div>

This #howto describes how to setup the Telegram provider included in `discourse-chat-integration`.

> [@](#):
>
> ⚠ Your site must have `force_https` enabled before you can connect to Telegram

# Enable the plugin

The `discourse-chat-integration` plugin is bundled with Discourse. If you haven’t already, follow the [main plugin instructions](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522) to enable it.

# Setup Telegram

1. Talk to the [Telegram “Botfather”](https://telegram.me/botfather) 🤖 and setup a new bot. [detailed instructions here](https://core.telegram.org/bots#how-do-i-create-a-bot)
2. Make sure to copy the **token** that the BotFather gives you. It will look something like this:

```plaintext
110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw

```

# Setup Discourse

1. In your site settings, paste the **token** you got earlier into the `chat integration telegram access token` setting, and save it

2. Enable the `chat_integration_telegram_enabled` setting, and save it

3. Go to the Plugins tab, then Chat Integrations

4. Go to the Telegram tab

# Adding a channel

1. Add your bot to a group chat on telegram (or just start a private chat with it)

2. Send any message to the bot (or in the group chat where the bot was added). You should receive a message with the Chat ID. You can also send a message starting with `/getchatid`.  

3. Copy the Chat ID. **If there’s a minus sign before it, make sure to include it - it’s very important!**

4. Go to your discourse admin panel, Plugins , Chat Integrations , Telegram

5. Click Add Channel

6. Enter a name for the channel (this is only displayed in the discourse admin panel, it can be anything)

7. Paste the **Chat ID** from earlier into the box, then click Save Channel  

8. Use the Test button on the channel you just created to check that everything’s working. You should see something like this:  

9. Setup some “Rules” for your channel, according to the [discourse-chat-integration](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522) instructions.

10. Enjoy all the notifications :allthethings:

# Using in a broadcast channel

To send notifications to a telegram broadcast channel, add the bot as a channel administrator, and then send the message

```plaintext
/getchatid

```

to obtain the chat ID. Then follow the instructions above to set up on Discourse. For public channels, you can also use the `@channelname` format (e.g. `@myforumchannel`) instead of the numeric chat ID.

In a broadcast channel you cannot use slash commands to manage rules.

# Slash commands

You can use “slash commands” to control rules from Telegram. Check that the `chat integration telegram enable slash commands` site setting is enabled. Note that this gives anyone who can post in the group chat permission to edit the rules.

To learn how to use them, just send `/help` (or `/help@my-forum-bot` if in a group chat) and the bot will send you a help message.

**Setting up command auto-complete** (not necessary, but makes it much easier to use)

1. Talk to the [Telegram BotFather](https://telegram.me/botfather) 🤖
2. Select your bot, click edit bot, then edit commands
3. Copy and paste this list of commands in

```plaintext
watch - [category] [tag:name] | notify this channel for new topics and new replies matching rule
follow - [category] [tag:name] | notify this channel for new topics matching rule
mute - [category] [tag:name] | block notifications to this channel for posts matching rule
remove - [rule number] | remove a rule (see /status for numbers)
status - list all rules for this channel
help - display a help message

```

4. You should get a success message 🙂

# Other bot customisations

Talk to the [Telegram BotFather](https://telegram.me/botfather) 🤖 to customise the name, description and icon for your bot. You should leave “Group Privacy” enabled, otherwise the bot will try and respond to every single message in a group chat.

> Last edited by @JammyDodger 2024-05-26T07:10:54Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [August 28, 2017, 3:43pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/2 "2017-08-28T15:43:42Z")

</div>

Isn’t possible to allow users to subscribe to any public category? Without asking an admin to add their id to the whitelist?

---

<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 28, 2017, 4:01pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/3 "2017-08-28T16:01:28Z")

</div>

Not currently. It is possibly something that could be added (this is how Slack works), but given there is no concept of “organisations” on telegram, we would need to be careful that only public-facing categories are visible.

For per-user stuff you could try the telegram-notifications-plugin

> [@Telegram Notifications Plugin (discourse-telegram-notifications)](https://meta.discourse.org/t/telegram-notifications-plugin/60483):
>
> [Discourse Telegram Notifications Plugin](https://github.com/davidtaylorhq/discourse-telegram-notifications) This plugin allows users to receive their notifications via a Telegram bot, allowing them to turn off email notifications and still keep up-to-date. success You can “like” posts, and respond to them via the bot. Here’s a quick demo video: Before Starting Your forum must be using HTTPS, and have force\_https turned on Your forum must be accessible to the internet, not only an internal network (in development, give [ngrok](https://ngrok.com/) a try). Getting t…

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [August 28, 2017, 4:05pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/4 "2017-08-28T16:05:11Z")

</div>

But that means two different bots 😅  
Anyway, thanks for such good plugins 👍

---

<div class="post-metadata">

### Author: ![mkpankov](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mkpankov](https://meta.discourse.org/u/mkpankov)
#### Post date: [July 23, 2018, 2:11pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/5 "2018-07-23T14:11:11Z")

</div>

I’ve set it up, and it works with bot itself. However, when I set it up for public channel and try to test, an error “422 No Reason Phrase” occurs.  
Could someone help me out?

---

<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: [July 29, 2018, 10:28pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/6 "2018-07-29T22:28:28Z")

</div>

> [@mkpankov](#):
>
> try to test, an error “422 No Reason Phrase” occurs

Where does this error occur? In telegram, or in the “test” dialog in the Discourse admin panel?

---

<div class="post-metadata">

### Author: ![iontishina1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iontishina1/32/109865_2.png) [@iontishina1](https://meta.discourse.org/u/iontishina1)
#### Post date: [August 28, 2018, 4:30pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/7 "2018-08-28T16:30:04Z")

</div>

Hi! I don’t see any submenu in the admin panel to manage Telegram settings

 ![37](https://global.discourse-cdn.com/meta/original/3X/8/1/81a3055a69d9ed3367df800b55e71df4e22e9ae5.png)

But i got my chat ID through the bot.

---

<div class="post-metadata">

### Author: ![iontishina1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iontishina1/32/109865_2.png) [@iontishina1](https://meta.discourse.org/u/iontishina1)
#### Post date: [August 28, 2018, 5:02pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/8 "2018-08-28T17:02:40Z")

</div>

![29](https://global.discourse-cdn.com/meta/original/3X/4/2/422e0a7697465eaba8c5e48eca5fc7c67fd71629.png)

---

<div class="post-metadata">

### Author: ![thaidb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thaidb/32/68488_2.png) [@thaidb](https://meta.discourse.org/u/thaidb)
#### Post date: [October 3, 2018, 2:34am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/9 "2018-10-03T02:34:20Z")

</div>

Hello,  
Can you tell me what different **Telegram notifications using the discourse-chat-integration plugin** and _Telegram Notifications Plugin (discourse-telegram-notifications)_

---

<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: [October 3, 2018, 8:12am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/10 "2018-10-03T08:12:17Z")

</div>

Check the very top of this topic: [Telegram Notifications Plugin (discourse-telegram-notifications)](https://meta.discourse.org/t/telegram-notifications-plugin-discourse-telegram-notifications/60483) (the part with the ⚠ next to it)

---

<div class="post-metadata">

### Author: ![henriquebastos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/henriquebastos/32/119496_2.png) [@henriquebastos](https://meta.discourse.org/u/henriquebastos)
#### Post date: [December 30, 2018, 4:40am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/11 "2018-12-30T04:40:21Z")

</div>

Whenever users reply to the Telegram bot message, it keeps informing them of the current chat ID, telling them to configure something different on the admin panel.

I have the actual message in Portuguese:

> Este chat está configurado WTTD Fórum. Configure-o no painel de administração. (ID do bate-papo:-1001093143218)

Google translated:

> This chat is configured for WTTD Forum. Configure it in the administration panel. (Chat ID: -1001093143218)

It’s quite annoying.

Also, I’ve disabled **chat integration telegram enable slash commands** , but it still replies with the command list.

**Is there a way to make the bot ignore any reply?**

---

<div class="post-metadata">

### Author: ![Pasquale\_De\_Leonardi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pasquale_de_leonardi/32/74998_2.png) [@Pasquale\_De\_Leonardi](https://meta.discourse.org/u/Pasquale_De_Leonardi)
#### Post date: [April 15, 2019, 2:37pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/12 "2019-04-15T14:37:05Z")

</div>

where can we Add the channel in discourse? we don’t find nothing… caht bot is active and we get also the Chat-ID, thanks in advance

---

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

</div>

After enabling the telegram site settings, head to your admin panel, click “plugins” at the top, then “chat integration” on the left.

---

<div class="post-metadata">

### Author: ![alexeykalinin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexeykalinin/32/138455_2.png) [@alexeykalinin](https://meta.discourse.org/u/alexeykalinin)
#### Post date: [April 15, 2019, 6:24pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/14 "2019-04-15T18:24:05Z")

</div>

Hello, i don’t know is it ok right now, but after setting up bot in admin and adding bot to channel nothing happened.

---

<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 15, 2019, 6:36pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/15 "2019-04-15T18:36:23Z")

</div>

Did you try using the “test channel” button. Did you get any errors?

---

<div class="post-metadata">

### Author: ![alexeykalinin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexeykalinin/32/138455_2.png) [@alexeykalinin](https://meta.discourse.org/u/alexeykalinin)
#### Post date: [April 15, 2019, 6:52pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/16 "2019-04-15T18:52:43Z")

</div>

`test channel` button works, but i expect ‘welcome’ message like in guide.

---

<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 15, 2019, 6:57pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/17 "2019-04-15T18:57:13Z")

</div>

I’m not sure which guide you are talking about. The chat-integration plugin doesn’t send a welcome message.

Once you have configured the channel, you need to add some “rules”. Then, topics/posts you make on your discourse forum will appear in Telegram.

---

<div class="post-metadata">

### Author: ![alexeykalinin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexeykalinin/32/138455_2.png) [@alexeykalinin](https://meta.discourse.org/u/alexeykalinin)
#### Post date: [April 15, 2019, 6:58pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/18 "2019-04-15T18:58:09Z")

</div>

> [@david](#):
>
> # Adding a channel
> 
> 1. Add your bot to a group chat on telegram (or just start a private chat with it)
> 2. You should receive a message like this  
> ![](https://global.discourse-cdn.com/meta/original/3X/a/9/a93da929fe93f42026310746823a6c19e15106b0.jpg)

I’m talking about this instruction.

---

<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 15, 2019, 7:03pm UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/19 "2019-04-15T19:03:32Z")

</div>

Ah, I see. Try sending a message in the group, including the bot’s username (like `@myforumbot`). Then it should respond with that message.

---

<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 23, 2019, 9:22am UTC](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603/21 "2019-04-23T09:22:14Z")

</div>

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:

> New rule: /[watch|follow|mute] [category] [tag:name]  
> (you must specify a rule type and at least one category or tag)
> 
> - watch – notify this channel for new topics and new replies
> - follow – notify this channel for new topics
> - mute – block notifications to this channel
> 
> Remove rule: /remove [rule number]  
> ([rule number] can be found by running /status)
> 
> List rules: /status
> 
> Help: /help

This msg has started irritating every time a member is added or removed into/from the telegram group.  
And if I create a telegram broadcast/channel and add the chat integration bot into that, this problem doesn’t arise therein.

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