This eval does not access to any node modules and can only shut your server down by certain memory leaks, though not all.
Easy: omegga install gh:Meshiest/safeeval
Manual:
git clone https://github.com/meshiest/omegga-safeeval safeeval
inplugins
directory
;code
- run code
You can write your own modules in the modules
directory. Check out the modules/demo.js
module for some boilerplate code.
This feature is more powerful when paired with the reloader plugin (omegga install gh:meshiest/reloader
) so modules are reloaded when you save.
Modules can be loaded in chat with the following api (ran in chat eval)
;this.loadModule('modulename')
- loadmodules/modulename.js
;this.addModule('modulename')
- enable loading ofmodules/modulename.js
on plugin init;this.addModule('modulename', true)
- enable loading ofmodules/modulename.js
on plugin init and run it (will not register commands);this.removeModule('modulename')
- disable loading ofmodules/modulename.js
on plugin init;this.resetModules()
- disable all modules from loading on init
The result of a module's exported function can be referenced by ;this.modules.modulename
, though the eval plugin itself or global
can be modified to run things easier.