From a0b87c7156cc04b7824b7d210310fd19b340fb57 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 5 Nov 2015 12:43:12 -0800 Subject: [PATCH] printers only --- plugins/printerfact.py | 8 +++----- plugins/shitposting.py | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/printerfact.py b/plugins/printerfact.py index dcab450..a68f637 100644 --- a/plugins/printerfact.py +++ b/plugins/printerfact.py @@ -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)) diff --git a/plugins/shitposting.py b/plugins/shitposting.py index 2963500..eaa7e60 100644 --- a/plugins/shitposting.py +++ b/plugins/shitposting.py @@ -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"