mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
add readme files for command and quotes [#75]
This commit is contained in:
parent
30a5878b97
commit
8bd9f93632
43
README.md
43
README.md
@ -18,53 +18,16 @@ Requirements:
|
|||||||
handles the IRC protocol.
|
handles the IRC protocol.
|
||||||
- Various modules have their own requirements also.
|
- 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 init
|
||||||
git submodule update
|
git submodule update
|
||||||
|
|
||||||
## Modules:
|
## 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
|
### Admin
|
||||||
|
|
||||||
Various administration functionality such as banning users, hot-reloading the
|
Various administration functionality such as banning users, hot-reloading the
|
||||||
|
14
modules/command/README.md
Normal file
14
modules/command/README.md
Normal 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
68
modules/quotes/README.md
Normal 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.
|
Loading…
Reference in New Issue
Block a user