Discourse Chat Bridge (currently only supports Telegram)

This should be site_settings :slight_smile:

2 Likes

Oh my god, thank you, I’ll change it right away

…And it shoud be in client.en.yml. I wrote the code in the early morning, and it looks like the code quality is a bit bad. :melting_face:

3 Likes

Amazing work, thanks for creating this!

4 Likes

I tested it a little, and it works fine! :+1:

2 Likes

Hello!
Thank you for such a wonderful plugin :raised_hands: This is what I’ve been thinking about for the last couple of months :confetti_ball:. You seem to have captured my thoughts :sweat_smile:
I want to clarify. Will the plugin only work for chat mode or can it also be connected to a topic?

Can you elaborate a little more specifically?

2 Likes

Hello! Sorry if I didn’t express my thoughts enough :pray:. I’m using Google Translate and can’t be sure I’m understanding the posts on this forum correctly. And I don’t know how to program, so I don’t always understand programmers’ messages. Let me show you my question in diagram form:

I probably understand what you mean… Do you want the content in chat to be published in the topic simultaneously?
I had a ready-made nodejs software before this, but it needed to be adapted to other forums. And I have been very busy recently and have no time to do this.
For a while, it will only support chat.

2 Likes

I’m not entirely sure if I understood your question correctly, but I’ll try to explain step by step what I envision. In the period from 2021 to 2022, I attempted to create a forum based on Discourse. However, despite the relevance of the forum, the project was unsuccessful because, in our region (Central Asia), the majority of residents prefer using messengers such as Telegram and WhatsApp instead of registering and using new features on websites.

With the advent of artificial intelligence, I observed changes in the rules of the game. Various services, including websites and applications designed for the use of artificial intelligence, emerged. Messengers cannot fully provide functionality for working with artificial intelligence, although Telegram is more advanced than WhatsApp. Learning about new plugins in Discourse, such as Discourse AI and Chatbot, I realized that this was a new opportunity for my website.

I want to fully utilize the ability to create thematic posts (topics). Recently, I asked a question here - on Meta about the Chatbot plugin, wondering if the GPT chat can remember the first post and not forget the content of the main topic after numerous messages in the thread. Then, @merefield replied that the chatbot will always remember the first post. This became the main criterion for applying this plugin on my site.

I plan to create thematic sections on the forum for interaction with artificial intelligence and real people. The communication format in Discourse through creating topics is more advanced technically compared to chats. Therefore, chats are not entirely suitable for training the bot since in a chat, the bot may not remember the initial topic among numerous recent messages. I plan to use the capability of creating thematic posts, training the bot in the first post so that it can respond to user questions within the specified topic.

However, considering the popularity of messengers in our region and people’s habit of using chats, I am contemplating how to provide users with the Discourse forum experience without abandoning their familiar messengers. After installing the Discourse Chat Bridge plugin, I found that it connects the Discourse chat with the Telegram chat but does not create a bridge between a published post on the forum and the Telegram chat.

My plans include:

  1. A user (possibly site personnel) sends a private message (PM) to the AI bot on the forum with instructions on how the bot should respond to subsequent messages, such as advising other users on using the forum.

  2. The user links this private message to the artificial intelligence in a regular Telegram bot.

  3. The user shares the link to the Telegram bot with other users who are not yet registered on the forum but want to learn more about it.

  4. Each user, clicking on the link in the Telegram bot, starts a private conversation with artificial intelligence, which responds and advises according to the instructions posted on the forum.

  5. All user messages directed to artificial intelligence are published in a private forum topic. Thus, Telegram users do not see messages from other Telegram users, as each user communicates separately with the Telegram bot.

So you plan to use the Telegram bot as a funnel for users coming to the forum or you want to allow users to stay only in Telegram interacting with the Ai bot (the Ai bot being a proxy between the forum content and the user)?

1 Like

All right… this looks like a very personalized feature and I don’t think I would add this feature for free, because my energy is very limited.

1 Like

Yes, that’s right, the telegram bot/chat will be used as a mirror and duplicate content from the forum and back.

Ok, I got you. I’m currently doing general prep work on my website. If you allow, I will return to this topic in a few weeks with more specific proposals in a personal message to you.

I’m very interested in this and offer to help if you need.

1 Like

Okay, thanks for the offer :raised_hands:, I’ll come back as soon as I’m ready.

1 Like

While testing, it seems I discovered a bug in the plugin. After I send a message to the chat via Telegram → Discourse, nothing appears on the site in the chat (sometimes only 1234567890.tgid username appears). To solve this problem I have to refresh the site page. After updating, the name of the message sender appears, but the contents of the message itself are not shown. To solve this problem, I rearrange the HTML and then the chat message text appears. Here’s a video:

Also, I wanted to clarify. If I send a message via Telegram to a group chat without using the Reply button, the message does not reach the chat in Discourse. It turns out that in order for the message to be sent, I must select the Reply function in telegram chat. But what if I don’t want to respond to anyone’s message in the chat, but just want to send a message with a question to all group members?

1 Like

I noticed this problem a few days ago, I just never got around to fixing it, really. My todo list is piled up right now.

A recent update to Discourse Chat broke this plugin. I need to find time to adapt it, or directly submit the functions I need to the core.

I’m waiting for a response. Now due to the lack of this feature, I need to monkey patch, and my plugin may be broken by a commit at any time.

2 Likes

Ok, I got you. I hope the development team will pay attention to your message :pray:

1 Like

Ok, I fixed this.

1 Like

The bridge plugin has is now compatible with the latest discourse test-passed version.

5 Likes