fix printer fact regex
This commit is contained in:
parent
d11e04a575
commit
46ba0694bb
|
@ -4,12 +4,13 @@ import requests, re, random
|
||||||
|
|
||||||
regex = re.compile(re.escape("cat"), re.IGNORECASE)
|
regex = re.compile(re.escape("cat"), re.IGNORECASE)
|
||||||
kittenrex = re.compile(re.escape("kitten"), re.IGNORECASE)
|
kittenrex = re.compile(re.escape("kitten"), re.IGNORECASE)
|
||||||
|
preggorex = re.compile(re.escape("pregmant"), re.IGNORECASE)
|
||||||
|
|
||||||
@hook.regex("PHP sadness$")
|
@hook.regex("PHP sadness$")
|
||||||
def php_fact(inp):
|
def php_fact(inp):
|
||||||
return "http://phpsadness.com/sad/" + str(random.randint(0,53))
|
return "http://phpsadness.com/sad/" + str(random.randint(0,53))
|
||||||
|
|
||||||
@hook.regex("printer fact$")
|
@hook.regex("^printer fact$")
|
||||||
@hook.command
|
@hook.command
|
||||||
def printerfact(inp, say=None):
|
def printerfact(inp, say=None):
|
||||||
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')
|
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')
|
||||||
|
|
Loading…
Reference in New Issue