Webhooks on chat messages?

AI-generated summary

In a discussion titled “Webhooks on chat messages?” under the Feature category with the tag “chat,” Olivier_Lambert shares that they built a chatbot named Robolivier using OpenAI and Discourse webhooks, which currently only responds when mentioned in topics — not in chat channels or direct messages, since chat messages aren’t available as webhook events. They ask if a plugin or setting exists to enable this. MarcP suggests using the existing Discourse Chatbot plugin, which supports topics, chats, and PMs, and notes that using the API for chat history may present challenges. RGJ agrees that a dedicated chat message webhook would be valuable, especially since the allowed_user_api_push_urls setting is now hidden, forcing users to poll notifications — an inefficient workaround. They ask if a plugin can add such a webhook trigger or if a pull request would be accepted. fbpbdmin concurs, noting that chat webhooks serve a distinct need. The discussion highlights demand for native webhook support for chat messages in Discourse, particularly for bot integrations and automation.

Hello! I’ve implemented a chatbot through OpenAi & Discourse’s Webhooks.

TL;DR, I created a user called Robolivier that replies when mentionned.

I would like to have him reply to a specific channel & to direct messages.

There are no “chat messages” in the list of events sent through webhook:

How would I go about doing that? Is there a plugin available? Maybe a setting I’ve missed?

2 Likes

Hey there, in case you didn’t know there is Discourse Chatbot :robot: (supporting ChatGPT) that already works in topics/chats/PM’s.

So unless you are building your bot for educational purposes, I would just install that if I were you.

I also think that doing this through API, because you probably want to get chat history to improve your AI responses, might be possible but you might bump into some challenges (correct me if I’m wrong).

1 Like

6 posts were merged into an existing topic: Discourse Chatbot :robot: (supporting ChatGPT)

But it would still be nice to have a webhook for chat messages, especially since allowed_user_api_push_urls is now a hidden setting. If you can’t use a plugin then right now all you can do is poll for notifications right now, which is pretty suboptimal.

Is there any way a plugin can add a webhook trigger option?
Would a PR be accepted for this?

4 Likes

agree, chat webhook is a different need,