From 1f056c0cb5df894f51ac24e1e3c6479e8dab3bfe Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 25 Sep 2016 13:54:53 -0400 Subject: [PATCH] [lore] Add permalink extraction for file objects --- plugins/lore.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/lore.py b/plugins/lore.py index a15ac75..eb0d523 100644 --- a/plugins/lore.py +++ b/plugins/lore.py @@ -178,5 +178,7 @@ def _scribe(): def _extract_lore(obj): if obj['type'] == 'message': 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 - return '```\n' + obj + '\n```' + return '```\n' + json.dumps(obj, indent=2) + '\n```'