printers only

This commit is contained in:
Christine Dodrill 2015-11-05 12:43:12 -08:00
parent 84cb8055db
commit a0b87c7156
2 changed files with 7 additions and 5 deletions

View File

@ -9,12 +9,10 @@ kittenrex = re.compile(re.escape("kitten"), re.IGNORECASE)
def php_fact(inp):
return "http://phpsadness.com/sad/" + str(random.randint(0,53))
@hook.regex("(.*) fact$")
@hook.regex("printer fact$")
@hook.command
def printerfact(inp, say=None):
if len(inp.group(1).split()) != 1:
return "I cowardly refuse to look that up"
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')
fact = r.json()['facts'][0]
inp = inp.group(1)
inp = "printer"
return kittenrex.sub("baby "+ inp, regex.sub(inp, fact))

View File

@ -17,3 +17,7 @@ def rickrollProtector(inp):
@hook.regex("[kK]-[lL]ine")
def kline(inp):
return "http://i.imgur.com/FQjQgyB.jpg"
@hook.command
def botsnack(inp):
return ":D"