[lore] Add permalink extraction for file objects

This commit is contained in:
Eryn Wells 2016-09-25 13:54:53 -04:00
parent 61c4af7d6d
commit 1f056c0cb5

View file

@ -178,5 +178,7 @@ def _scribe():
def _extract_lore(obj): def _extract_lore(obj):
if obj['type'] == 'message': if obj['type'] == 'message':
return obj['message']['permalink'] return obj['message']['permalink']
elif obj['type'] == 'file':
return obj['file']['permalink']
# If nothing matches just return the object itself as a preformatted JSON object # If nothing matches just return the object itself as a preformatted JSON object
return '```\n' + obj + '\n```' return '```\n' + json.dumps(obj, indent=2) + '\n```'