Simple JS/Node code VM/Sandbox executing bot for Freenode IRC
- Clone the repo into your computer / server.
- Make sure to set the correct registered Nick and Pass through the
config
object. - Set the
channels
property to array of channels which the bot should join after authentication. - Run
node index.js
.
Some channels ask users to identify before joining, that's why this bot make sure that NickServ sent a NOTICE to the bot starting with "You are now identified for". After that, code start to join required channels. If you've a better way to handle that, please make a PR.
- The bot will listen for any channel message starting with
!jsrun
, considering your nick isjsrun
. - The bot will run the message contents as code, and reply with the response, mentioning the message sender at the beginning of the reply.
Usage of vm2 guarantee the executing of JS/Node code in VM/Sandbox, which mean the executed code cann't access document
, process
, this
and others of critical objects that would been accessible in case of running the code using eval.
You're very welcome to make PR at anytime.