[jsonbot] now taking all cmd args
This commit is contained in:
parent
3cad591086
commit
dc681fdc35
@ -16,11 +16,10 @@ 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:
|
response = repdata
|
||||||
response = repdata
|
|
||||||
else:
|
else:
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
if tag in data.keys():
|
if tag in data.keys():
|
||||||
@ -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)")
|
||||||
|
Loading…
Reference in New Issue
Block a user