Skip to content

esoui/lexicon

Repository files navigation

Lexicon

Lexicon is a bot based on NLP.js that currently hangs in ESOUI room on Gitter.

Repository

Here's a brief summary of the most important locations in the repository.

  • src/index.js is the NLP.js bot entrypoint.
  • src/connector is where we put different connectors, e.g. Matrix, Discord, etc.
  • src/features is where we put what the bot can do.
  • storage is used to store runtime data generated by the bot.
  • support is used during development to launch Matrix and Element instances.

Development

You'll need Node.js v20+.

You can just run the bot, providing a connector and its configuration. It'll automatically install dependencies if needed.

npm start -- --connector console

💡 The console connector is the easiest one to use if you're just working on bot features.

Local Matrix

We provide support files to launch local Matrix and Element instances so you can test drive your bot. You'll need Docker v20+ and Docker Compose plugin installed. Also, make sure ports 8000 and 8008 are available.

docker compose -f support/compose.yml up

⚠️ If it fails with a "Permission denied" error, stop the containers and run docker compose -f support/compose.yml run --rm synapse generate. It'll fix up the /data directory ownership, then you can start the containers again.

Head over to http://localhost:8000, sign-up and use the credentials with the bot:

npm start -- -c matrix -h http://matrix.local.crz.li -u bot -p thisisnotsecure -x

ℹ️ We use the hostname matrix.local.crz.li because it resolves to 127.0.0.1, and it's also the hostname of the container.

Deployment

You'll need Docker v20+ and Docker Compose plugin installed. Clone the repository, then copy example.env to .env and edit it appropriately. Finally, launch the bot service in background.

docker compose up -d

Legal

The MIT License © 2016 Arthur Corenzan and collaborators.