"safe-eval lets you execute JavaScript code without having to use the much discouraged and feared upon eval(). safe-eval has access to all the standard JavaScript API of the underlying engine. It is implemented using node's vm module." [1]
It's important to note that running code in vm.runInNewContext is not advised for 'untrusted code' according to the documentation. So probably not good to let random people use this bot.
"script.runInNewContext() is quite useful, but safely running untrusted code requires a separate process."[0]
[1] https://www.npmjs.com/package/safe-eval