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