Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
/ imagemagick-vk-bot Public archive

TypeScript image processing bot example with nodejs c++ bindings

Notifications You must be signed in to change notification settings

xzeldon/imagemagick-vk-bot

Repository files navigation

ImageBot

The simplest NodeJS bot that processes images sent to it using ImageMagick 7. Uses the Magick++ API and node-addon-api.

For example, two commands are currently implemented:

  • jpeg — strongly compresses the image.
  • liquid — distorts the image using the Seam Carving algorithm.

Setup

Windows is not supported platform! Use WSL if you want to run the bot on Windows!

First of all, preferably you should install ImageMagick from source.

You must also have the developer tools installed to compile C/C++ like GCC (if you use debian/ubuntu just type apt install build-essential in terminal).

Then just clone this repository. Type npm i and all the dependencies will install.

Once you do that, you're almost up and running. Type npm run build. This will build the bot and put the output files in the dist folder.

Now you need to set the token. You can hard-set it in the code (line 13), or export it as an environment variable (which I recommend doing). To do this, type export TOKEN=your_token

Finally, just type node dist/index.js.