no fun allowed
This commit is contained in:
parent
aba4aa1352
commit
24308d6983
|
@ -11,6 +11,9 @@ def php_fact(inp):
|
||||||
|
|
||||||
@hook.regex("(.*) fact$")
|
@hook.regex("(.*) fact$")
|
||||||
def printerfact(inp, say=None):
|
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')
|
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')
|
||||||
fact = r.json()['facts'][0]
|
fact = r.json()['facts'][0]
|
||||||
inp = inp.group(1)
|
inp = inp.group(1)
|
||||||
|
|
Loading…
Reference in New Issue