Discobot for training

So the way to do it is set it up on heroku and get an api key which you past into the discourse settings, correct?

You can host Hubot wherever - mine is running on the same server as Discourse.

You need to create a user in Discourse, and generate an API key for it to paste into the Hubot settings. This grants hubot permission to post under that Discouse account.

1 Like

Exciting! :smiley: Is there a public demo somewhere? Or sample hubot code?

It might be less confusing to just point you towards the Hubot docs for building/installing. You can follow it pretty closely, but use the Discourse adapter instead:

yo hubot --adapter=discourse-adapter

I don’t have a public demo, and I’ve dockerized and separated all of my scripts. I’ve already linked them in the Hubot topic if you’re still curious, but I’d urge you to stay on Hubot’s documentation.


Great, thank you awole20! So, can I use the discobot account to do a hubot?

Don’t see why not - all you need is a Discourse username and an associated API key. Give it a shot!

Hi @awole20, where do we enter the variables

  • HUBOT_DISCOURSE_USERNAME the username the bot will connect as.
  • HUBOT_DISCOURSE_KEY the API key for the user. This needs to be a user API key, not a site-wide API key.
  • HUBOT_DISCOURSE_SERVER the discourse server eg https://discourse.example.com/ ?

Is it in the actual bot after you enter bin/hubot?

Those are set from environment variables, which can be set in a number of ways. The simplest of which is editing your bin/hubot and adding:

export HUBOT_DISCOURSE_SERVER=https://discourse.example.com/

before the exec line.

Bear in mind that the discourse key is a password, and so this file (or any env file) should be treated as secret and kept safe.

Certainly, now it is always running after I enter the bin/hubot cmd? I have it installed on the same server as Discourse?

I have that all in the file, and loaded it up with the API etc from the discobot. I even uncommented some of the scripts file to use, but when I replied @discobot open the pod bay doors, or “badgers” it just gave me the default discobot reply. Is it maybe overriding the messages of hubot?

Ah, yes that could definitely be a problem - Try creating a separate account for your learningbot that is separate from Discobot.

Okay, I made a separate user, and loaded the api into the hubot in bin/hubot -a discourse-adapter and now it works.

Now how do I keep it on when I’m not in the SSH terminal? I’m on a Ubuntu server, on AWS EC2.

Thank you!

I actually get this error when I bin/hubot

npm WARN hubot-help@0.2.2 requires a peer of coffee-script@^1.12.6 but none is installed. You must install peer dependencies yourself.

up to date in 1.25s

I think that warning is fine; not sure you need to worry about that specifically.

You’re starting to wade deep in linux tooling land, and you might have to do some reading up on init scripts if you want your scripts more robust to be able to start on boot/restart.

nohup bin/hubot -a discourse-adapter & should work in a pinch though.

1 Like

I entered that into the console, what will that do? I think it now works even though I’m not in the console any longer :slight_smile: thank you!

How do I restart it with new scripts loaded in? Do I have to stop it first?

For killing the job, pkill hubot is quick and dirty.

Heres some resources for you to get started-


Great, thank you for all the help! I think I’ve got a good start now.

Now, is there a way to have the bot respond like discobot, where you reply to a specific post and can just continue a conversation?

For example

Bot: Here is your training point 1 point 2 point 3 reply next to get part 4 5 6
Human: Okay, next
Bot: here is part 4, 5 6

and so on…

Go search for your own Hubot plugins on npm + github, there are a ton of them.

For your specific request:



I have no experience with wit.ai, but it sounds cool – If it fulfills your requirements, go for it!

1 Like

It is just programming something to do something. A plug-in would be code that you right to modify or add on to already existing software.

Nope. I have never developed ne before

Nevermind, I got everything working, I’m actually using dialogflow now and it works amazing!

1 Like