mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 02:24:12 +01:00
Added some help and Dunno.stats.
This commit is contained in:
parent
4a7e2dba20
commit
83e16fa4bb
17
ChangeLog
17
ChangeLog
@ -1,14 +1,19 @@
|
||||
* Added Dunno.stats, to return the number of dunnos in the
|
||||
database.
|
||||
|
||||
* Added the Currency plugin, to perform currency conversions.
|
||||
|
||||
* Added conf.supybot.plugins.Karma.allowSelfRating, which determines
|
||||
whether users are allowed to adjust the karma of their current nick.
|
||||
* Added conf.supybot.plugins.Karma.allowSelfRating, which
|
||||
determines whether users are allowed to adjust the karma of their
|
||||
current nick.
|
||||
|
||||
* Added --nolimit option to Misc.last, which causes it to return all
|
||||
matches that are in the history.
|
||||
* Added --nolimit option to Misc.last, which causes it to return
|
||||
all matches that are in the history.
|
||||
|
||||
* Added conf.supybot.plugins.Herald.defaultHerald, which provides
|
||||
a default herald to use for unregistered users. Herald.default was
|
||||
also added as a friendly interface to managing the defaultHerald.
|
||||
a default herald to use for unregistered users. Herald.default
|
||||
was also added as a friendly interface to managing the
|
||||
defaultHerald.
|
||||
|
||||
* Added Weather.wunder, which uses wunderground.com to report the
|
||||
current weather status.
|
||||
|
@ -30,8 +30,9 @@
|
||||
###
|
||||
|
||||
"""
|
||||
The Dunno module is used to spice up the "replyWhenNotCommand" behavior with
|
||||
random "I dunno"-like responses.
|
||||
The Dunno module is used to spice up the 'replyWhenNotCommand' behavior with
|
||||
random 'I dunno'-like responses. If you want something spicier than '<x> is
|
||||
not a valid command'-like responses, use this plugin.
|
||||
"""
|
||||
|
||||
__revision__ = "$Id$"
|
||||
@ -56,6 +57,11 @@ except ImportError:
|
||||
dbfilename = os.path.join(conf.supybot.directories.data(), 'Dunno.db')
|
||||
|
||||
class Dunno(callbacks.Privmsg):
|
||||
"""This plugin was written initially to work with MoobotFactoids, the two
|
||||
of them to provide a similar-to-moobot-and-blootbot interface for factoids.
|
||||
Basically, it replaces the standard 'Error: <X> is not a valid command.'
|
||||
messages with messages kept in a database, able to give more personable
|
||||
responses."""
|
||||
priority = 100
|
||||
def __init__(self):
|
||||
callbacks.Privmsg.__init__(self)
|
||||
@ -208,6 +214,12 @@ class Dunno(callbacks.Privmsg):
|
||||
new_dunno, id)
|
||||
self.db.commit()
|
||||
irc.replySuccess()
|
||||
|
||||
def stats(self, irc, msg, args):
|
||||
"""Returns the number of dunnos in the dunno database."""
|
||||
cursor = self.db.cursor()
|
||||
cursor.execute("""SELECT COUNT(*) FROM dunnos""")
|
||||
irc.reply(cursor.fetchone()[0])
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user