[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,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)")