[jsonbot] now taking all cmd args

This commit is contained in:
Max 2015-07-03 00:05:01 +01:00 committed by nemunaire
parent 3cad591086
commit dc681fdc35

View File

@ -16,7 +16,6 @@ def getRequestedTags(tags, data):
if isinstance(data, list): if isinstance(data, list):
for element in data: for element in data:
repdata = getRequestedTags(tags, element) repdata = getRequestedTags(tags, element)
if repdata:
if response: if response:
response = response + "\n" + repdata response = response + "\n" + repdata
else: else:
@ -55,7 +54,7 @@ def get_json_info(msg):
if len(msg.cmds) == 2: if len(msg.cmds) == 2:
raise IRCException("Please specify the keys to return (%s)" % ", ".join(getJsonKeys(json_data))) 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) response = getRequestedTags(tags, json_data)
return Response(response, channel=msg.channel, nomore="No more content", count=" (%d more lines)") return Response(response, channel=msg.channel, nomore="No more content", count=" (%d more lines)")