no fun allowed

This commit is contained in:
Christine Dodrill 2015-11-04 12:12:30 -08:00
parent aba4aa1352
commit 24308d6983
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,9 @@ def php_fact(inp):
@hook.regex("(.*) fact$")
def printerfact(inp, say=None):
if len(inp.group(1).split()) != 1:
return None
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')
fact = r.json()['facts'][0]
inp = inp.group(1)