mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
debug
This commit is contained in:
parent
1471bdac0c
commit
ff7ed67bba
@ -21,7 +21,7 @@ def query_detection(bot, trigger):
|
|||||||
|
|
||||||
commands_list = dict()
|
commands_list = dict()
|
||||||
for commandstype in bot.memory['SpiceBot_CommandsQuery']['commands'].keys():
|
for commandstype in bot.memory['SpiceBot_CommandsQuery']['commands'].keys():
|
||||||
# if commandstype != 'rule':
|
if commandstype != 'rule':
|
||||||
for com in bot.memory['SpiceBot_CommandsQuery']['commands'][commandstype].keys():
|
for com in bot.memory['SpiceBot_CommandsQuery']['commands'][commandstype].keys():
|
||||||
if com not in commands_list.keys():
|
if com not in commands_list.keys():
|
||||||
if commandstype == 'nickname':
|
if commandstype == 'nickname':
|
||||||
@ -32,7 +32,12 @@ def query_detection(bot, trigger):
|
|||||||
triggerargsarray = spicemanip.main(trigger, 'create')
|
triggerargsarray = spicemanip.main(trigger, 'create')
|
||||||
|
|
||||||
# command issued, check if valid
|
# command issued, check if valid
|
||||||
querycommand = spicemanip.main(triggerargsarray, 1).lower()[1:]
|
querycommand = spicemanip.main(triggerargsarray, 1).lower()[1:] or None
|
||||||
|
if not querycommand:
|
||||||
|
return
|
||||||
|
bot.say(str(querycommand))
|
||||||
|
bot.say("no querycommand")
|
||||||
|
|
||||||
if len(querycommand) == 1:
|
if len(querycommand) == 1:
|
||||||
commandlist = []
|
commandlist = []
|
||||||
for command in commands_list.keys():
|
for command in commands_list.keys():
|
||||||
@ -45,7 +50,7 @@ def query_detection(bot, trigger):
|
|||||||
bot.notice("The following commands match " + str(querycommand) + ": " + spicemanip.main(commandlist, 'andlist') + ".", trigger.nick)
|
bot.notice("The following commands match " + str(querycommand) + ": " + spicemanip.main(commandlist, 'andlist') + ".", trigger.nick)
|
||||||
return
|
return
|
||||||
|
|
||||||
elif querycommand.endswith(tuple(["+"])):
|
elif querycommand.endswith("+"):
|
||||||
querycommand = querycommand[:-1]
|
querycommand = querycommand[:-1]
|
||||||
if querycommand not in commands_list.keys():
|
if querycommand not in commands_list.keys():
|
||||||
bot.notice("The " + str(querycommand) + " does not appear to be valid.")
|
bot.notice("The " + str(querycommand) + " does not appear to be valid.")
|
||||||
@ -57,7 +62,7 @@ def query_detection(bot, trigger):
|
|||||||
bot.notice("The following commands match " + str(querycommand) + ": " + spicemanip.main(validcomlist, 'andlist') + ".", trigger.nick)
|
bot.notice("The following commands match " + str(querycommand) + ": " + spicemanip.main(validcomlist, 'andlist') + ".", trigger.nick)
|
||||||
return
|
return
|
||||||
|
|
||||||
elif querycommand.endswith(tuple(['?'])):
|
elif querycommand.endswith('?'):
|
||||||
querycommand = querycommand[:-1]
|
querycommand = querycommand[:-1]
|
||||||
sim_com, sim_num = [], []
|
sim_com, sim_num = [], []
|
||||||
for com in commands_list.keys():
|
for com in commands_list.keys():
|
||||||
@ -78,9 +83,6 @@ def query_detection(bot, trigger):
|
|||||||
bot.notice("The following commands match " + str(querycommand) + ": " + str(querycommand) + ".", trigger.nick)
|
bot.notice("The following commands match " + str(querycommand) + ": " + str(querycommand) + ".", trigger.nick)
|
||||||
return
|
return
|
||||||
|
|
||||||
elif not querycommand:
|
|
||||||
return
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
commandlist = []
|
commandlist = []
|
||||||
for command in commands_list.keys():
|
for command in commands_list.keys():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user