diff --git a/README.md b/README.md index 861b725..75e95e2 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,6 @@ commands in the cloned repository: ## Modules: -### Admin - -Various administration functionality such as banning users, hot-reloading the -code and ordering him to talk. Note that commands added here are handled with -their own listener, rather than being part of the command logic which is handled -by the Command module. Functionality in this module can be slightly unsafe as -not much error checking on the input is performed. - -TODO: Add summaries for each command in this module. - ### Spelling Will attempt to correct a users' spelling by using the levenshtein distance @@ -56,33 +46,3 @@ to correct another users like so: > userone: I am a tutrle. > usertwo: userone: *turtle > usertwo thinks userone meant: I am a turtle. - -### JS - -This module provides two commands which allow the execution of Javascript code. -For regular users, there is the *~js* command, which is completely sandboxed, -but can still be used for calculation and the like. - - > ~js Array(16).join('wat'-1) + " Batman!"; - 'NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!' - -This feature is fairly safe as the user doesn't have access to anything -dangerous, and is safe from infinite loops or locking DBot up because the code -which is run is killed if it does not finish within a short amount of time. - -For administrators, the incredibly useful *~ajs* command is also available. The -input for this command is simply 'eval'-ed and therefore has full access to -DBot's memory. Of course, this is incredibly unsafe, but I find it rather fun; -remember to only give extremely trusted friends administrator access to DBot, as -there's nothing to stop them wiping the database or something similar - if -you're worried about that kind of thing, do not load this module. - -However, it's useful for many things, such as administrative activity for -which there isn't a command in the admin module. For example, you could hot-add -a new administrator like this: - - > ~ajs dbot.admin.push('batman'); - 2 - -You can also use this for debugging, or even adding new commands while DBot is -running. diff --git a/modules/js/README.md b/modules/js/README.md new file mode 100644 index 0000000..57f0afd --- /dev/null +++ b/modules/js/README.md @@ -0,0 +1,40 @@ +## JS + +Run JavaScript. + +### Description + +This module provides two commands which allow the execution of Javascript code +from the bot. + +### Commands + +#### ~js [code] +For regular users, there is the *~js* command, which is completely sandboxed, +but can still be used for calculation and the like. + + > ~js Array(16).join('wat'-1) + " Batman!"; + 'NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!' + +This feature is fairly safe as the user doesn't have access to anything +dangerous, and is safe from infinite loops or locking DBot up because the code +which is run is killed if it does not finish within a short amount of time. + +#### ~ajs [code] +For administrators, the incredibly useful *~ajs* command is also available. The +input for this command is simply 'eval'-ed and therefore has full access to +DBot's memory. Of course, this is incredibly unsafe, but I find it rather fun; +remember to only give extremely trusted friends administrator access to your +DBot instance, as there's nothing to stop them wiping the database or probably +even your hard drive - if you're worried about that kind of thing, do not load +this module. + +However, it's useful for many things, such as administrative activity for +which there isn't a command in the admin module. For example, you could hot-add +a new administrator like this: + + > ~ajs dbot.admin.push('batman'); + 2 + +You can also use it for debugging, or even adding new commands while DBot is +running.