Telegram Notifications Plugin (discourse-telegram-notifications)

AI-generated summary

The Discourse Telegram Notifications Plugin, developed by david, enables individual Discourse users to receive their forum notifications via Telegram bot — not for group chat sync or topic creation from chat. It’s distinct from the discourse-chat-integration plugin, which sends topic notifications to Telegram groups/channels. Both can coexist but require separate bots. Setup requires HTTPS, internet accessibility (e.g., via ngrok in dev), and BotFather configuration. Users receive a Chat ID via bot message, which they paste into their Discourse preferences. A data explorer query helps track active users. The plugin is a work in progress; david notes future goals include streamlining the user setup flow. Some users reported compatibility or SSL errors (e.g., Siddhu_Dhangar, Surendra-Patil), which david addressed with updates. Flashio noted tag-change notifications appearing as replies — a behavior mitigated in later Discourse updates, though not fully configurable. danb35 resolved a non-working setup by correcting the Chat ID. david merged a contribution from barreeeiroo. nildarar asked about using {name} instead of {username} in translations — david confirmed this requires code changes. The plugin is unofficial despite david being a Discourse team member.

Discourse Telegram Notifications Plugin

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 a try).

Getting the plugin setup

  1. Install the plugin using the instructions here: How to install a plugin
  2. Create a telegram bot by talking to the BotFather (instructions here)
  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

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:

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, here, here and here

As always, suggestions and comments are very welcome :slight_smile:

71개의 좋아요

문서 어디에도 그룹을 만들라고 한 내용은 보이지 않고, 오히려 봇이 그룹에 추가되는 것을 허용하지 말라는 권장 사항이 보입니다. 봇이 포함된 그룹이 아니라 봇에게 직접 메시지를 보내세요.

OP(원문)에 따르면(상단의 그늘진 상자에도 명시되어 있음), 이 두 플러그인은 서로 다른 역할을 합니다:

1개의 좋아요

OP(첫 글 작성자)의 답변:

직접 해본 적은 없지만, 그 답변이 질문에 대한 답이 되는 것 같습니다.

1개의 좋아요

안녕하세요. 이 기능이 현재 작동 중인가요?

이 문장을 새로운 데이터 탐색기 쿼리에 복사하면 Internal Server Error가 발생합니다.

데이터베이스에서 해당 문장을 직접 실행하면 정상적으로 동작합니다.

이상하네요. 사용 가능한 표준 쿼리 중 몇 가지를 시도해 봤는데, 일부는 정상적으로 작동했지만 다른 쿼리에서는 동일한 오류가 발생했습니다.

Discourse: 3.0.0 안정판 및 3.0.1 안정판

두 버전 모두 텔레그램 알림과 텔레그램을 통한 주제 답글 기능이 깨졌습니다. API 키를 재생성해도 문제가 해결되지 않습니다. 답글 작성이 작동하지 않으며, 이전처럼 봇이 답글이 전송되었음을 확인해 주지도 않습니다.

이 문제에 대한 해결책이 있을까요? 아니면 이 플러그인의 지원이 종료된 건가요? :frowning:

Telegram Notifications 상자를 "프로필"에서 "알림"으로 이동하는 것이 더 합리적이지 않나요? 프로필(제 경우에는 사용자 서명 아래)에서 이 설정을 찾을 것이라고 예상하지 못해 찾아야 했습니다. :wink:

1개의 좋아요

아니요. 이 플러그인의 목적은 다음과 같습니다:

다음 링크를 확인해 보시는 것이 좋습니다:

1개의 좋아요