* Document image.js a bit
* Close image.js sockets in all code paths
I'm not sure whether sockets get GC'd when the function returns
* Remove getFormat
It was only called from one place, and the object property names were
quite confusing
* Clean up image.js conditional a bit
I had to write out an entire truth table for this and work it all out
Thinking hard
* Move actual ImageMagick calling into separate file
This gets rid of the weird, brain-melting ouroboros of code that
recurses across threads and processes.
* Reduce amount of getType wrangling
This amounted to an awful lot of dead conditionals after the image
commands were all modified to pass in image types anyway. This has also
led to two different implementations diverging, which causes bugs like
GIF commands applied to non-GIFs erroring instead of providing a
user-friendly message.
* Unify image-runner return type, clarify image type
This allows us to remove the fromAPI parameter from image-runner, and
helps greatly clarify the behavior around image types.
* Deduplicate GIF code, fix "not a GIF" handling
The special "nogif" value is now stored as the image type instead of its
value, as the value must always be a Buffer now--no loosely-typed
shenanigans.
This is a common issue, and I ran into it while installing esmBot. For me, and probably others npm throws a permissions error while building, and no packages will be installed. Simply chown the package.json to the node:node user, and this will work again.
* feat: add docker-compose file
* refactor: lower docker-compose version
* feat(docker-compose): add help docs and image dir, fix lavalink
* fix(docker): missing ffmpeg dependency
* fix(docker): compile imagemagick with pango support
This fixes commands such as `meme` causing the bot to crash, since Alpine does not have a pango-enabled version of IM7 in its repos.
* feat(docker): cache npm dependencies
By copying just the `package-(lock).json` and installing dependencies, Docker will cache the deps on subsequent builds.
* fix(docker-compose): need to adjust connection addresses
The MongoDB and Chrome addresses are automatically passed through with the correct value. A separate `servers.json` file specifically for docker-compose is used with the correct container addresses.
Each container has a static ip - this is due to an unfortunate limitation of the Chrome remote debugger, which needs either an IP or `localhost`, and refuses connections to a hostname.
* refactor(docker): do not include servers.json for compose
Compose will use the normal `servers.json` and users will have to change the hostnames to `lavalink` and `api` respectively.