[lore] Add !scribe skeleton
This commit is contained in:
parent
855625d88c
commit
61c4af7d6d
1 changed files with 11 additions and 1 deletions
|
@ -16,7 +16,8 @@ MAX_PINS = 100
|
|||
LORE_FILE = 'lore.json'
|
||||
CHANNELS = {}
|
||||
|
||||
LORE_RE = re.compile(r'!lore(\s+(?P<count>\d+))')
|
||||
LORE_RE = re.compile(r'!lore\s+(?P<count>\d+)')
|
||||
SCRIBE_RE = re.compile(r'!scribe\s+(?P<message>.*)')
|
||||
|
||||
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']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue