Telegram Notifications Plugin (discourse-telegram-notifications)

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:

「いいね!」 68

I don’t see anywhere in the docs that it says to create a group, and in fact I see a recommendation to disallow the bot from being added to a group. Send a message directly to the bot, not to a group that includes the bot.

According to the OP (it’s even in a shaded box at the top), they do different things:

「いいね!」 1

From the OP:

I haven’t done it myself, but that appears to answer the question.

「いいね!」 1

こんにちは。この機能は現在動作していますか?

このステートメントを新しいデータエクスプローラークエリにコピーすると、「内部サーバーエラー」が発生します。

データベースで直接ステートメントを試すと、機能します。

奇妙です。利用可能な他の標準クエリをいくつか試しました。いくつかは機能しましたが、他のクエリでも同じエラーが発生しました。

Discourse: 3.0.0 stable および 3.0.1 stable

どちらのバージョンでも Telegram 通知が壊れ、Telegram を介したトピックへの返信もできなくなりました。API キーを再生成しても解決しません。返信は機能しておらず、以前のように返信が送信されたことをボットが確認しません。

この問題の解決策はありますか?それともこのプラグインのサポートは終了しましたか? :frowning:

「Telegram Notifications」ボックスを「Profile」から「Notifications」に移動した方が、より理にかなっていると思いませんか? プロファイル(私の場合はユーザー署名の下)にあるとは予想していなかったので、探す必要がありました。 :wink:

「いいね!」 1

いいえ。これがその目的です。

以下を参照することをお勧めします。

「いいね!」 1