Hubot Adapter for Discourse

Hubot can be configured with both pre-written plug-in scrips, as well as ad-hoc scripts. You can get started with hubot pretty quickly over commandline for local barebones testing of responses. This adapter is only here to allow it to “speak” and respond over discourse.

I ended up splitting up my bot from my custom configuration, so that I could run tests against my custom scripts.

The dice roller can be seen here and I have an additional (and much simpler) “if you here anything about ‘the deals’ respond in kind” script for fun.

You can set it up that way - The adapter responds via discourse’s native notifications. Basically, if there’s a discourse notification of a message, the bot will see it. In the bot’s Discourse profile, you can edit and add to the watched categories to allow it to automatically see new topics/replies/etc without a direct @.

EG: for your use case, you would probably want to add your interested categories to “watching first post” and set the “when I post in a topic set that topic to” normal. That way, the bot gets notified on new topics, but does not continue to monitor/reply afterwards.

Not currently - It follows the same patterns from other hubot adapters - aside from setting up what hubot “hears” in discourse, you really shouldn’t have to mind much about the internals. Mostly you’d be interested in the API, and the difference between function hooks like robot.hear vs robot.respond. See the docs for examples!

1 Like