3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00
dbot/modules/quotes
Douglas Gardner a53eb5e0d2 begin transition from English to ISO-639 with #234
This patch converts all English language strings used within
depressionbot's localisation interface (that is, strings.json) to their
ISO-639-1 equivalents.

The purpose of this patch is to make the strings.json file less
English-dependent.

All languages with an ISO-639-1 code have been converted; that is,
English, Spanish and Welsh, to ``en``, ``es`` and ``cy`` respectively.

This patch does not attempt to force a solution to the issue of Na'vi:
the language does not have a large enough corpus to warrant its own ISO
639-3 code, and as such there is no perfect solution. For the time
being, this patch keeps the Na'vi language as its English language
string ("Na'vi"). A possible solution to this discrepancy includes using
the ISO 639-3 code ``art``, used for artificial languages that do not
qualify for an official code, or by using local use codes specified
in ISO 639-3 (qaa to qtz).

This patch requires collaboration with upstream repositories that also
use strings.json, such as the Github and Stats modules.
2013-02-12 18:39:15 +00:00
..
commands.js remove timers.js [#170] 2013-01-27 20:52:11 +00:00
config.json Fix quote interpol + no need to pass event [#230][#156] 2013-01-26 20:08:09 +00:00
pages.js transform quotes [#131] 2013-01-15 14:47:46 +00:00
quotes.js remove timers.js [#170] 2013-01-27 20:52:11 +00:00
README.md add readme for users 2013-01-15 21:43:09 +00:00
strings.json begin transition from English to ISO-639 with #234 2013-02-12 18:39:15 +00:00
usage.json loaded strings and usage from the modules themselves in reloadModules. some other smaller changes. fixed the syntax of the usage json. careful though this dbot init may delete your database. 2012-12-11 20:06:29 +00:00

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.

Show a link to the page on the web interface which shows this categorys 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.

API

getQuote(event, category)

Returns a random quote from the given category.

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.