fix printer fact regex

This commit is contained in:
Christine Dodrill 2015-11-09 12:38:53 -08:00
parent d11e04a575
commit 46ba0694bb
1 changed files with 2 additions and 1 deletions

View File

@ -4,12 +4,13 @@ import requests, re, random
regex = re.compile(re.escape("cat"), re.IGNORECASE)
kittenrex = re.compile(re.escape("kitten"), re.IGNORECASE)
preggorex = re.compile(re.escape("pregmant"), re.IGNORECASE)
@hook.regex("PHP sadness$")
def php_fact(inp):
return "http://phpsadness.com/sad/" + str(random.randint(0,53))
@hook.regex("printer fact$")
@hook.regex("^printer fact$")
@hook.command
def printerfact(inp, say=None):
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')