Building a custom bot

AI-generated summary

j127 is building a custom bot that responds to user commands in public topics. The bot will be triggered by mentions of its name, followed by a command and arguments. After discovering that Discobot cannot achieve this, j127 plans to use a webhook receiver in a cloud function and the Discourse API to post replies.

Canapin suggests looking at an existing interactive fiction game bot, Discourse Frotz, for inspiration.

j127 appreciates the suggestion and plans to start with simple, preset commands to load activities into topics. The long-term goal is to create a more intelligent bot using a framework like Rasa.

I’ve been looking for a way to create a custom bot that users can interact with in public topics. They would be able to type something like

@botname command arg1 arg2

and the bot would reply in the topic with the requested output.

It looks like it isn’t possible to do that with discobot, so I was going to write a webhook receiver in an external cloud function to listen for mentions of the custom bot’s name. The bot would then post a reply via the API.

Has anyone done something similar to that already in a plugin? Or is there a better way to implement that kind of feature?

I thought I would ask here, because sometimes I ask a question and it turns out that there is already an existing solution.

Maybe take a look at this?

Thanks, that gives me some ideas. To start, I just want some simple, preset commands that load activities into a topic, but eventually I’m hoping to create a more intelligent bot using a framework like Rasa.