Added @help values

Fixed Mess
This commit is contained in:
Terence Simpson
2008-05-05 17:44:14 +01:00
parent e0d9db683f
commit eb2dcaade2
6 changed files with 38 additions and 8 deletions

View File

@ -232,6 +232,10 @@ class Bantracker(callbacks.Plugin):
return msg
def btlogin(self, irc, msg, args):
"""takes no arguments
Sends you a message with a link to login to the bantracker.
"""
if msg.tagged('identified'):
try:
user = ircdb.users.getUser(msg.prefix[:msg.prefix.find('!')])

View File

@ -238,7 +238,7 @@ class Bugtracker(callbacks.PluginRegexp):
def rename(self, irc, msg, args, oldname, newname, newdesc):
"""<oldname> <newname>
Rename the bugtracker associated with <oldname> to <newname>
Rename the bugtracker associated with <oldname> to <newname>.
"""
try:
name = self.shorthand[oldname.lower()]

View File

@ -75,6 +75,10 @@ class Encyclopedia(callbacks.Plugin):
self.alert = False
def addeditor(self, irc, msg, args, name):
"""<name>
Adds the user with the name <name> to the list of editors.
"""
if not capab(msg.prefix, 'addeditors'):
return
try:
@ -86,6 +90,10 @@ class Encyclopedia(callbacks.Plugin):
addeditor = wrap(addeditor, ['text'])
def removeeditor(self, irc, msg, args, name):
"""<name>
Removes the user with the name <name> from the list of editors.
"""
if not capab(msg.prefix, 'addeditors'):
return
try:
@ -97,11 +105,19 @@ class Encyclopedia(callbacks.Plugin):
removeeditor = wrap(removeeditor, ['text'])
def editors(self, irc, msg, args):
"""takes no arguments
Lists all the users who are in the list of editors.
"""
irc.reply(', '.join([ircdb.users.getUser(u).name for u in ircdb.users.users \
if 'editfactoids' in ircdb.users.getUser(u).capabilities]), private=True)
editors = wrap(editors)
def moderators(self, irc, msg, args):
"""takes no arguments
Lists all the users who can add users to the list of editors.
"""
irc.reply(', '.join([ircdb.users.getUser(u).name for u in ircdb.users.users \
if 'addeditors' in ircdb.users.getUser(u).capabilities]), private=True)
moderators = wrap(moderators)
@ -516,6 +532,7 @@ class Encyclopedia(callbacks.Plugin):
"""takes no arguements
Downloads a copy of the database from the remote server.
Set the server with the configuration variable supybot.plugins.Encyclopedia.remotedb.
"""
if not capab(msg.prefix, "owner"):
irc.error("Sorry, you can't do that")

View File

@ -70,6 +70,10 @@ class FreenodeAuth(callbacks.Plugin):
return msg
def login(self, irc, msg, args):
"""takes no arguments
Allows users who are identified to NickServ to login without a password.
"""
if not msg.tagged('identified'):
irc.error(conf.supybot.replies.incorrectAuthentication())
return

View File

@ -21,7 +21,7 @@ def configure(advanced):
Mess = conf.registerPlugin('Mess')
conf.registerChannelValue(conf.supybot.plugins.Mess, 'enabled',
registry.Boolean(False,"""Enable the non-offensive mess that ubugtu can spit out in the
registry.Boolean(False,"""Enable the non-offensive mess that the bot can spit out in the
channel"""))
conf.registerChannelValue(conf.supybot.plugins.Mess, 'offensive',
registry.Boolean(False,"""Enable all possibly offensive mess that the bot can spit out in the

View File

@ -34,17 +34,17 @@ mess = {
'hamster': ('Hamster quotes', 'http://hamsterrepublic.com/dyn/bobsez', r'<font.*?<b>(?P<fact>.*?)</font>', False),
#'yourmom': ('', 'http://pfa.php1h.com', r'<p>(?P<fact>.*?)</p>', True),
'bush': ('Bush quotes', 'http://www.dubyaspeak.com/random.phtml', r'(?P<fact><font.*</font>)', True),
#'southpark': ('', 'http://www.southparkquotes.com/random.php?num=1', r'<p>(?P<fact>.*)</p>', True),
#southpark': ('', 'http://www.southparkquotes.com/random.php?num=1', r'<p>(?P<fact>.*)</p>', True),
'mjg': ('Matthew Garrett facts', 'http://www.angryfacts.com', r'</p><h1>(?P<fact>.*?)</h1>', False),
'mjg59': ('Matthew Garrett facts', 'http://www.angryfacts.com', r'</p><h1>(?P<fact>.*?)</h1>', False),
'vmjg': ('Virtual Matthew Garrett', 'http://www.rjek.com/vmjg59.cgi', r'<body>(?P<fact>.*?)<p>', True),
'vmjg59': ('Virtual Matthew Garrett', 'http://www.rjek.com/vmjg59.cgi', r'<body>(?P<fact>.*?)<p>', True),
'shakespeare': ('Shakespeare quotes', 'http://www.pangloss.com/seidel/Shaker/', r'<font.*?>(?P<fact>.*?)</font>', False),
'lugradio': ('Lugradio facts', 'http://planet.lugradio.org/facts/', r'<h2>\s*(?P<fact>.*?)</h2>', False),
'bofh': ('BOFH excuses', '%s/Mess/bofh.txt' % conf.supybot.directories.plugins[1], 'BOFH Excuse #%d: ', False),
'42': ('HHGTTG quotes', '%s/Mess/42.txt' % conf.supybot.directories.plugins[1], '', False),
'magic8ball': ('The magic 8ball', '%s/Mess/ball.txt' % conf.supybot.directories.plugins[1], '', False),
'ferengi': ('Ferengi rules of acquisition', '%s/Mess/ferengi.txt' % conf.supybot.directories.plugins[1], 'Ferengi rule of acquisition ', False)
'bofh': ('BOFH excuses', '%s/Mess/bofh.txt' % conf.supybot.directories.plugins()[1], 'BOFH Excuse #%d: ', False),
'42': ('HHGTTG quotes', '%s/Mess/42.txt' % conf.supybot.directories.plugins()[1], '', False),
'magic8ball': ('The magic 8ball', '%s/Mess/ball.txt' % conf.supybot.directories.plugins()[1], '', False),
'ferengi': ('Ferengi rules of acquisition', '%s/Mess/ferengi.txt' % conf.supybot.directories.plugins()[1], 'Ferengi rule of acquisition ', False),
}
data = {}
for m in mess.keys():
@ -181,6 +181,9 @@ class Mess(callbacks.PluginRegexp):
# str(s) if s is unicode!
@ok
def dice(self, irc, msg, args, count):
"""[<count>]
Roll the dice, if count is given then roll that many times.
"""
if not count: count = 1
elif count > 5: count = 5
elif count < 1: count = 1
@ -227,7 +230,9 @@ class Mess(callbacks.PluginRegexp):
@ok
def pony(self, irc, msg, args, text):
""" NO! """
"""[<user>]
Can you or <user> have a pony?
"""
if not text:
text = 'you'
irc.reply("No %s can't have a pony, %s!" % (text, msg.nick))