From 2c53416cc6cc32a50bba64809191aeb16a2b980d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 25 Sep 2016 14:12:10 -0400 Subject: [PATCH] [lore] Cap lorebombs at 30 --- plugins/lore.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/lore.py b/plugins/lore.py index 3669363..2a0a170 100644 --- a/plugins/lore.py +++ b/plugins/lore.py @@ -13,8 +13,10 @@ from service import slack LOGGER = logging.getLogger('cookie') MAX_PINS = 100 +MAX_LORE = 30 LORE_FILE = 'lore.json' CHANNELS = {} +ANGER_MESSAGES = [':anger:', ':angry:'] LORE_RE = re.compile(r'!lore\s+(?P\d+)') SCRIBE_RE = re.compile(r'!scribe\s+(?P.*)') @@ -159,6 +161,8 @@ def process_message(data): # def _lore(channel, count): + if count > MAX_LORE: + return [random.choice(ANGER_MESSAGES)] pins = channel.saved_pins if not pins: return None