# Telegram Notifications Plugin (discourse-telegram-notifications)

**URL:** https://meta.discourse.org/t/telegram-notifications-plugin-discourse-telegram-notifications/60483
**Category:** Plugin
**Created:** [April 5, 2017, 2:09pm UTC](https://meta.discourse.org/t/telegram-notifications-plugin-discourse-telegram-notifications/60483 "2017-04-05T14:09:57Z")
**Posts on this page:** 1
**Showing post:** 1

<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 5, 2017, 2:09pm UTC](https://meta.discourse.org/t/telegram-notifications-plugin-discourse-telegram-notifications/60483/1 "2017-04-05T14:09:57Z")

</div>

# [Discourse Telegram Notifications Plugin](https://github.com/davidtaylorhq/discourse-telegram-notifications)

> [@](#):
>
> ⚠ Do not confuse this with the [discourse-chat-integration plugin](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522), they do different things.
> 
> If you want to send notifications about posts to telegram group chats or broadcast channels, use discourse-chat-integration.
> 
> If you want users to receive their notifications via telegram, use this plugin.
> 
> The two plugins can co-exist, but you MUST connect them to two different telegram bots.

> [@](#):
>
> :philosoraptor: This is not an official plugin (despite @david being a member of the team)

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:

[https://global.discourse-cdn.com/meta/original/3X/f/5/f5cf32bb52caf0cefdba1b55b9876247f441649b.mp4](https://global.discourse-cdn.com/meta/original/3X/f/5/f5cf32bb52caf0cefdba1b55b9876247f441649b.mp4)

# 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 the plugin setup

1. Install the plugin using the instructions here: [How to install a plugin](https://meta.discourse.org/t/install-a-plugin/19157)
2. Create a telegram bot by talking to the [BotFather](https://telegram.me/botfather) (instructions [here](https://core.telegram.org/bots#6-botfather))
3. Paste the “token” into the site setting “telegram access token”
4. Tick “telegram notifications enabled”

I strongly recommend you use the BotFather’s `/setjoingroups` command to disable the bot being used for group chats. It is not designed for it, and risks leaking information that users are not supposed to be able to access (e.g. you don’t want private messages being sent to a group chat).

You can set the name/picture/description of your bot using the instructions [here](https://core.telegram.org/bots#botfather-commands)

# For users to receive notifications

1. Send a message to the bot, you’ll receive a message back that looks like

> To get notifications for Discourse, enter the ‘Chat ID’ 1234567 in your user preferences

1. Visit your Discourse user preferences, and paste the number in the `Telegram Notifications` box
2. You should now receive notifications by telegram message!

# Find out who’s using telegram for notifications

Here’s a query for the [data explorer plugin](https://meta.discourse.org/t/data-explorer-plugin/32566):

```sql
SELECT user_id, updated_at, value from user_custom_fields
WHERE name = 'telegram_chat_id'

```

* * *
This is still a work in progress. I think the next task would be to improve the setup flow for the user, so they don't have to copy/paste numbers between telegram and the forum.

Related discussions are: [here](https://meta.discourse.org/t/connecting-telegram-bot-to-discourse/55962), [here](https://meta.discourse.org/t/telegram-bots-anyone/60216), [here](https://meta.discourse.org/t/discourse-and-chatbot-integrations/60372) and [here](https://meta.discourse.org/t/common-event-system-for-chatrooms-a-specification/59245)

As always, suggestions and comments are very welcome 🙂

---

_[View the full topic](https://meta.discourse.org/t/telegram-notifications-plugin-discourse-telegram-notifications/60483)._
