The logic for investmentcat can be found in the botutils folder. It logs interaction to the logs/ folder.
The bot can be started with
rtmbot
Investmentcat uses two configuration files, rtmbot.conf (used to configure the RTMbot framework) and investmentcat.cfg
# Add the following to rtmbot.conf
DEBUG: True # make this False in production
SLACK_TOKEN: "xoxb-11111111111-222222222222222"
ACTIVE_PLUGINS:
- plugins.greeter.ParserPlugin
[slack]
channel=CXXXXXXXX
bot_id=UYYYYYYYY
The main script for the bot can be found in bot_engine/investmentcat_bot.py
This script uses several components from the bot_engine module.
This component is responsible for determining the entities and intents that were passed to the bot.
As the bot becomes more complex, it will need to remember the current state of the interaction with the end-user and use that to help drive the interaction.
The folder bot_engine/executors has a series of functions that handle the execution of incoming requests. Examples include a module to manage valuations, one to manage recommendations, and one to handle the low-level interaction with the finance data api.
Add the new logic to the query parser, adding code to isolate the configuration of tokens and return an intent & entities.
Write the executor, either as a new file under bot_engine/executors or as additional functions in existing files in bot_engine/executors. The executor is a function that takes whatever parameters it needs to call external logic and returns the full formatted text of the output that will be displayed back to the user.
Import the executor function into the special bot_engine/investmentcat_bot.py file and handle the new intent.