Slack Bot made as a project for one of the cohorts.
The idea is to start a bot which will ask a Slack user a series of yes or no questions to determine the final advice. Each question depends on the previous answer.
The bot can handle different questionaires. The example file (questions.json
) has a set of them. With the current behavior, the bot randomly chooses one and begins asking questions.
- Generate new configuration in your Slack channel here, by visiting your channel's configuration panel.
- Clone this repository
- Create a
.env
file based on the.env-sample
file - Navigate to the home directory of the cloned repository and run a
npm install
command - Run
npm start
The data model is in a JSON format and it is an array of objects. Each object inside this array represents a questionnaire. The graph of questions is represented with fields in the questionnaire object. The starting question is found in 'q' property. Then, the question which should be asked when user answers "yes" is stored in 'qy' field while the one for "no" answer is in 'qn' field. For each step further the field is appended with 'y' for "yes" and 'n' for "no". Once the bot reaches an array of objects instead of an object, it presents a random element of this array as a final answer.
If user will reply 'no' to the first question from a category then the bot will choose another category (in progress).
- Manage when the user responds 'no' to the first question
- Enrich the method which handles natural language processing, so it will recognize broader range of answers
- Allow private conversations with the bot (forcing user to address bot for every answer is kind of annoying)