printers only
This commit is contained in:
parent
84cb8055db
commit
a0b87c7156
|
@ -9,12 +9,10 @@ kittenrex = re.compile(re.escape("kitten"), re.IGNORECASE)
|
||||||
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("(.*) fact$")
|
@hook.regex("printer fact$")
|
||||||
|
@hook.command
|
||||||
def printerfact(inp, say=None):
|
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')
|
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 = "printer"
|
||||||
return kittenrex.sub("baby "+ inp, regex.sub(inp, fact))
|
return kittenrex.sub("baby "+ inp, regex.sub(inp, fact))
|
||||||
|
|
|
@ -17,3 +17,7 @@ def rickrollProtector(inp):
|
||||||
@hook.regex("[kK]-[lL]ine")
|
@hook.regex("[kK]-[lL]ine")
|
||||||
def kline(inp):
|
def kline(inp):
|
||||||
return "http://i.imgur.com/FQjQgyB.jpg"
|
return "http://i.imgur.com/FQjQgyB.jpg"
|
||||||
|
|
||||||
|
@hook.command
|
||||||
|
def botsnack(inp):
|
||||||
|
return ":D"
|
||||||
|
|
Loading…
Reference in New Issue