diff --git a/plugins/lore.py b/plugins/lore.py index e36feda..a15ac75 100644 --- a/plugins/lore.py +++ b/plugins/lore.py @@ -16,7 +16,8 @@ MAX_PINS = 100 LORE_FILE = 'lore.json' CHANNELS = {} -LORE_RE = re.compile(r'!lore(\s+(?P\d+))') +LORE_RE = re.compile(r'!lore\s+(?P\d+)') +SCRIBE_RE = re.compile(r'!scribe\s+(?P.*)') outputs = [] @@ -145,9 +146,14 @@ def process_message(data): if lore: for l in lore: outputs.append([chid, l]) + return except KeyError as e: LOGGER.error("Couldn't process !lore command: {}".format(e)) + m = SCRIBE_RE.match(text) + if m: + _scribe() + # # Private # @@ -165,6 +171,10 @@ def _lore(channel, count): out_lore.add(lore) return out_lore +def _scribe(): + LOGGER.error('!scribe not implemented yet :-(') + pass + def _extract_lore(obj): if obj['type'] == 'message': return obj['message']['permalink']