Added minor documentation

master
Matthew Ramina 2013-11-28 22:23:32 -05:00 committed by mutantmonkey
parent d6e28ac26b
commit 9219308170
7 changed files with 15 additions and 2 deletions

View File

@ -46,6 +46,8 @@ def eightball(phenny, input):
quote = random.choice(quotes)
phenny.reply(quote)
eightball.commands = ['8ball']
eightball.name = '8ball'
eightball.example = '.8ball is pie amazing?'
if __name__ == '__main__':
print(__doc__.strip())

View File

@ -17,6 +17,7 @@ def botfight(phenny, input):
phenny.do(response % otherbot)
botfight.commands = ['botfight']
botfight.priority = 'low'
botfight.example = '.botfight'
def bothug(phenny, input):
""".bothug - Hug the other bot in the channel."""
@ -24,6 +25,7 @@ def bothug(phenny, input):
phenny.do("hugs %s" % otherbot)
bothug.commands = ['bothug']
bothug.priority = 'low'
bothug.example = '.bothug'
if __name__ == '__main__':
print(__doc__.strip())

View File

@ -68,7 +68,7 @@ def wa(phenny, input):
phenny.say(answer)
wa.commands = ['wa']
wa.example = '.wa answer to life'
if __name__ == '__main__':
print(__doc__.strip())

View File

@ -38,3 +38,4 @@ def imdb(phenny, input):
except:
phenny.reply("No results found for '%s'." % query)
imdb.commands = ['imdb']
imdb.example = '.imdb Promethius'

View File

@ -103,6 +103,7 @@ p_command = r'\.in ([0-9]+(?:\.[0-9]+)?)\s?((?:%s)\b)?:?\s?(.*)' % periods
r_command = re.compile(p_command)
def remind(phenny, input):
"""Set a reminder"""
m = r_command.match(input.bytes)
if not m:
return phenny.reply("Sorry, didn't understand the input.")
@ -131,6 +132,8 @@ def remind(phenny, input):
w += time.strftime(' at %H:%MZ', time.gmtime(t))
phenny.reply('Okay, will remind%s' % w)
else: phenny.reply('Okay, will remind in %s secs' % duration)
remind.name = 'in'
remind.example = '.in 15 minutes do work'
remind.commands = ['in']
r_time = re.compile(r'^([0-9]{2}[:.][0-9]{2})')

View File

@ -75,6 +75,7 @@ r_query = re.compile(
)
def gcs(phenny, input):
"""Compare the number of Google results for the specified paramters."""
if not input.group(2):
return phenny.reply("Nothing to compare.")
queries = r_query.findall(input.group(2))
@ -93,6 +94,7 @@ def gcs(phenny, input):
reply = ', '.join('%s (%s)' % (t, formatnumber(n)) for (t, n) in results)
phenny.say(reply)
gcs.commands = ['gcs', 'comp']
gcs.example = '.gcs Ronaldo Messi'
r_bing = re.compile(r'<h3><a href="([^"]+)"')
@ -133,7 +135,8 @@ def duck_search(query):
m = r_duck.search(bytes)
if m: return web.decode(m.group(1))
def duck(phenny, input):
def duck(phenny, input):
"""Queries DuckDuckGo for specified input."""
query = input.group(2)
if not query: return phenny.reply('.ddg what?')
@ -145,6 +148,7 @@ def duck(phenny, input):
phenny.bot.last_seen_uri[input.sender] = uri
else: phenny.reply("No results found for '%s'." % query)
duck.commands = ['duck', 'ddg']
duck.example = '.duck football'
def search(phenny, input):
if not input.group(2):

View File

@ -43,6 +43,7 @@ def urbandict(phenny, input):
response = "{0} - {1}".format(result['definition'].strip()[:256], url)
phenny.say(response)
urbandict.name = 'urb'
urbandict.rule = (['urb'], r'(.*)')
if __name__ == '__main__':