From dc681fdc35da5d256b6b6a5a3245ca682f54ef5f Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 3 Jul 2015 00:05:01 +0100 Subject: [PATCH] [jsonbot] now taking all cmd args --- modules/jsonbot.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/jsonbot.py b/modules/jsonbot.py index a784849..6339a52 100644 --- a/modules/jsonbot.py +++ b/modules/jsonbot.py @@ -16,11 +16,10 @@ def getRequestedTags(tags, data): if isinstance(data, list): for element in data: repdata = getRequestedTags(tags, element) - if repdata: - if response: - response = response + "\n" + repdata - else: - response = repdata + if response: + response = response + "\n" + repdata + else: + response = repdata else: for tag in tags: if tag in data.keys(): @@ -55,7 +54,7 @@ def get_json_info(msg): if len(msg.cmds) == 2: raise IRCException("Please specify the keys to return (%s)" % ", ".join(getJsonKeys(json_data))) - tags = msg.cmds[2].split(',') + tags = ','.join(msg.cmds[2:]).split(',') response = getRequestedTags(tags, json_data) return Response(response, channel=msg.channel, nomore="No more content", count=" (%d more lines)")