إعداد تكامل Telegram باستخدام إضافة discourse-chat-integration

يشرح هذا #الدليل كيفية إعداد مزود Telegram المضمن في discourse-chat-integration.

تفعيل الإضافة

يتم تجميع إضافة discourse-chat-integration مع Discourse. إذا لم تكن قد قمت بذلك بالفعل، اتبع إرشادات الإضافة الرئيسية لتفعيلها.

إعداد Telegram

  1. تحدث إلى BotFather الخاص بـ Telegram :robot: وأنشئ بوتًا جديدًا. تعليمات مفصلة هنا
  2. تأكد من نسخ الرمز المميز (token) الذي يمنحك إياه BotFather. سيبدو شيئًا كهذا:
    110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
    

إعداد Discourse

  1. في إعدادات موقعك، الصق الرمز المميز الذي حصلت عليه سابقًا في الإعداد chat integration telegram access token، وقم بحفظه

  2. قم بتفعيل الإعداد chat_integration_telegram_enabled، وقم بحفظه

  3. انتقل إلى علامة التبويب Plugins، ثم Chat Integrations

  4. انتقل إلى علامة التبويب Telegram

    • ملاحظة: إذا لم تكن علامة التبويب Telegram مرئية، فهذا يعني أن شيئًا ما سار بشكل خاطئ عند الاتصال بواجهة برمجة التطبيقات الخاصة بهم. يجب عليك التحقق من سجلات موقعك، ثم المحاولة مرة أخرى عن طريق إعادة تفعيل الإعداد chat_integration_telegram_enabled

إضافة قناة

  1. أضف البوت الخاص بك إلى محادثة جماعية على تيليجرام (أو ابدأ محادثة خاصة معه)

  2. أرسل أي رسالة إلى البوت (أو في الدردشة الجماعية التي تمت إضافة البوت إليها). يجب أن تتلقى رسالة بمعرف الدردشة (Chat ID). يمكنك أيضًا إرسال رسالة تبدأ بـ /getchatid.

  3. انسخ معرف الدردشة. إذا كانت هناك علامة ناقص قبل الرقم، فتأكد من تضمينها - فهذا مهم جدًا!

  4. انتقل إلى لوحة إدارة Discourse الخاصة بك، Plugins، Chat Integrations، Telegram

  5. انقر فوق Add Channel

  6. أدخل اسمًا للقناة (يتم عرضه فقط في لوحة إدارة Discourse، ويمكن أن يكون أي شيء)

  7. الصق معرف الدردشة من السابق في المربع، ثم انقر فوق Save Channel

  8. استخدم زر Test على القناة التي أنشأتها للتو للتحقق من أن كل شيء يعمل. يجب أن ترى شيئًا كهذا:

  9. قم بإعداد بعض “القواعد” لقناتك، وفقًا لتعليمات discourse-chat-integration.

  10. استمتع بكل الإشعارات :allthethings:

الاستخدام في قناة بث (broadcast channel)

لإرسال الإشعارات إلى قناة بث تيليجرام، أضف البوت كمسؤول للقناة، ثم أرسل الرسالة

/getchatid

للحصول على معرف الدردشة. ثم اتبع التعليمات أعلاه للإعداد على Discourse. بالنسبة للقنوات العامة، يمكنك أيضًا استخدام التنسيق @channelname (على سبيل المثال، @myforumchannel) بدلاً من معرف الدردشة الرقمي.

في قناة بث، لا يمكنك استخدام الأوامر المائلة لإدارة القواعد.

الأوامر المائلة (Slash commands)

يمكنك استخدام “الأوامر المائلة” للتحكم في القواعد من Telegram. تحقق من تمكين إعداد الموقع chat integration telegram enable slash commands. لاحظ أن هذا يمنح أي شخص يمكنه النشر في الدردشة الجماعية إذنًا لتعديل القواعد.

لمعرفة كيفية استخدامها، أرسل فقط /help (أو /help@my-forum-bot إذا كنت في دردشة جماعية) وسيرسل لك البوت رسالة مساعدة.

إعداد الإكمال التلقائي للأوامر (غير ضروري، ولكنه يسهل الاستخدام بكثير)

  1. تحدث إلى BotFather الخاص بـ Telegram :robot:
  2. حدد البوت الخاص بك، وانقر فوق edit bot، ثم edit commands
  3. انسخ والصق قائمة الأوامر هذه
    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. يجب أن تحصل على رسالة نجاح :slight_smile:

تخصيصات أخرى للبوت

تحدث إلى BotFather الخاص بـ Telegram :robot: لتخصيص الاسم والوصف والأيقونة للبوت الخاص بك. يجب أن تترك “خصوصية المجموعة” (Group Privacy) ممكّنة، وإلا سيحاول البوت الرد على كل رسالة في الدردشة الجماعية.

27 إعجابًا

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

إعجاب واحد (1)

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

إعجاب واحد (1)

But that means two different bots :sweat_smile:
Anyway, thanks for such good plugins :+1:

إعجاب واحد (1)

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?

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

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

But i got my chat ID through the bot.

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

Check the very top of this topic: Telegram Notifications Plugin (discourse-telegram-notifications) (the part with the :warning: next to it)

إعجابَين (2)

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?

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

إعجاب واحد (1)

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

3 إعجابات

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

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

إعجاب واحد (1)

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

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.

إعجاب واحد (1)

أنا أتحدث عن هذا الدليل.

إعجاب واحد (1)

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

3 إعجابات

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.