Knowledge Base

Find all the Troubleshooting/Frequently Asked Questions(FAQ's) and more about hubot under this section.

Hubot Decoded

This section is to help users who want to explore hubot from a developer's point of view. The hubot we are talking about is provided by Github. We have customized it to work with individual tools using coffeescript, node packages and REST API. Let us explore more about the structure that is followed by each hubot created and customized by us:

Each bot will have the following folders/files in it. Click on each link to know more about its purpose:

 bin

This folder contains system files (shell scripts/batch file) which is used to run hubot. When we start/restart the hubot, we basically execute this shell/batch file residing in this folder, so it is the main entrypoint of every hubot.

It is recommended that you do not tamper with this file to avoid errors in hubot execution

 node_modules
Hubot is a node based software, hence needs node packages to run. As the name suggests, this folder will contain all those packages to aid the hubot. You might wonder why there is a predefined node_modules folder in the bot, we could have just mentioned all dependencies in a package.json file and run npm install command each time we installed the bot. The reason we have an explicit folder pre-filled with packages is that some node packages (viz. githubot etc.) are customized by us to work exclusively with our hubots.
 scripts

This folder contains all the coffeescripts and js files through which hubot will listen and execute your commands.

 external-scripts.json

This json file will contain an array of node package names which you want to be loaded to memory every time the hubot starts. If you get duplicate answers from bot, ensure this file contains empty array ([]).

 hubot-scripts.json

This file will contain an array of coffeescript files which you want to be loaded when hubot starts. As soon as the bot starts, it will search for the Coffee files mentioned here in myhubot/node_modules/hubot-scripts/src/scripts folder. If you have your coffeescript in myhubot/scripts folder then no need to mention it in this file.