3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 03:33:07 +01:00

add readme files for command and quotes [#75]

This commit is contained in:
reality 2012-12-29 23:05:16 +00:00
parent 30a5878b97
commit 8bd9f93632
3 changed files with 85 additions and 40 deletions

View File

@ -18,53 +18,16 @@ Requirements:
handles the IRC protocol.
- Various modules have their own requirements also.
### JSBot
### External Modules
JSBot can be imported by running the following commands in the cloned repository:
JSBot and externally developed modules can be imported by running the following
commands in the cloned repository:
git submodule init
git submodule update
## Modules:
### Command
This handles the command execution logic for DBot.
1. Does the input match a command key in *dbot.commands* ?
2. Is there a quote category which matches the first part of the input
(*~category*)?
3. Is there a command name similar to to the first part of the input (*~name*)
in *dbot.commands*?
This is the only module which is force loaded, even if it's not in the
configuration.
### Quotes
This is the original reason that DBot was created, stores and displays quotes.
Commands:
- _~q category_ - Display a random quote from a given category.
- _~qadd category=newquote_ - Add a new quote to the database.
- _~qstats_ - Show a list of the biggest quote categories.
- _~qsearch category needle_ - Search for a quote in a given category.
- _~rmlast [category]_ - Remove the last quote added to a given category, or the
last quote added.
- _~rm category quote_ - Remove a given quote from the given category.
- _~qcount category_ - Show the number of quotes stored in the given category.
- _~rq_ - Show a random quote from a random category.
- _~d_ - Show a quote from the category which matches the bot's name.
- _~link category_ - Create a link to the page on the web interface which displays the
given category's quotes.
- _~qprune_ - Delete empty quote categories.
Unfortunately, this module is fairly highly coupled with certain other areas of
the program. I am working on this, but note, for example, that one can still
access quotes with the *~category* syntax even if the quotes module isn't
loaded.
### Admin
Various administration functionality such as banning users, hot-reloading the

14
modules/command/README.md Normal file
View File

@ -0,0 +1,14 @@
## Command
Handles the command execution logic for DBot.
### Description
1. Does the input match a command key in *dbot.commands* ?
2. Is there a quote category which matches the first part of the input
(*~category*)?
3. Is there a command name similar to to the first part of the input (*~name*)
in *dbot.commands*?
This is the only module which is force loaded, even if it's not specified in
the configuration file.

68
modules/quotes/README.md Normal file
View File

@ -0,0 +1,68 @@
## Quotes
Stores and displays quotes.
### Description
This is the original reason that DBot was created, stores and displays quotes.
### Configuration
#### rmLimit: 10
Amount of quotes which can be removed before admin approval is required.
### Commands
#### ~q [category]
Display a random quote from a given category.
#### ~qadd [category] = [quote]
Add a new quote to the database.
#### ~qstats
Show a list of the biggest quote categories.
#### ~qsearch [category] = [needle]
Search a category for quotes including the given text.
#### ~rmlast [category]
Remove the last quote added to a given category.
#### ~rmstatus
Show how many quotes are currently in the removal cache, and whether they will
be randomly removed.
#### ~rm [category] = [quote]
Remove a given quote from the given category.
#### ~qcount [category]
Show the number of quotes stored in the given category, or if called without a
category it will show the total number of quotes in the database.
#### ~rq
Show a random quote from the database.
#### ~link [category]
Show a link to the page on the web interface which shows this category's quotes.
### Admin-only Commands
#### ~rmconfirm
Confirm that the quotes currently in the removal cache are okay to be removed,
and permanently delete them.
#### ~rmdeny
Re-instate the quotes that are currently in the removal cache back into the main
quote database.
### Removal Spam Protection
When quotes are removed using either the ~rm or ~rmlast commands, the quotes are
removed from the main database, but are stored in a removal cache which is cleared
out ten minutes from the last time a quote was removed from the database. If the
number of quotes removed from the database reaches a certain limit (as per rmLimit
in config, default 10) then the counter is removed and the cache will not be deleted
automatically. In such a case, a DBot admin needs to either run the ~rmconfim command
to have the removal cache cleared, or ~rmdeny to re-instate all of the quotes in
the removal cache back into the main quote database. This is to stop mass
removal from the database without limiting the user interface.