Amazebot / bbot

An adaptable conversation engine for building bespoke bots.
MIT License
55 stars 2 forks source link

Start exported bot from script entry point #50

Open timkinnane opened 6 years ago

timkinnane commented 6 years ago

The default export for the main npm module does not start the bot, so it can be required and started manually after manual configuration / manipulation. However, in most cases it will be configured from command line args and started immediately, loading scripts automatically. In that case, e.g. for a Glitch or Heroku instance as a node package requiring bBot, the entry point might be a script that calls require('bbot/dist/start') or executes it directly from node, with node -r dotenv/config node_modules/bbot/dist/start.

Need to test this in different production environments to see if it's effective.

NB: Glitch actually loads environment by default, so the start script would just need node node_modules/bbot/dist/start with a scripts dir.

See https://github.com/Amazebot/bbot/blob/master/src/start.spec.ts#L5