mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
don't load asterisk regex
This commit is contained in:
parent
23404108f6
commit
b2a7c5e3ca
@ -97,9 +97,9 @@ def setup(bot):
|
|||||||
detected_lines.append(line)
|
detected_lines.append(line)
|
||||||
|
|
||||||
if len(detected_lines):
|
if len(detected_lines):
|
||||||
bot.memory['SpiceBot_CommandsQuery']['counts'] += 1
|
|
||||||
|
|
||||||
filelinelist = []
|
filelinelist = []
|
||||||
|
currentsuccesslines = 0
|
||||||
for detected_line in detected_lines:
|
for detected_line in detected_lines:
|
||||||
|
|
||||||
# Commands
|
# Commands
|
||||||
@ -117,31 +117,40 @@ def setup(bot):
|
|||||||
validcoms = list(validcoms)
|
validcoms = list(validcoms)
|
||||||
else:
|
else:
|
||||||
validcoms = [validcoms]
|
validcoms = [validcoms]
|
||||||
|
if "(.*)" in validcoms:
|
||||||
|
while "(.*)" in validcoms:
|
||||||
|
validcoms.remove("(.*)")
|
||||||
|
|
||||||
validcomdict = {"comtype": comtype, "validcoms": validcoms}
|
if len(validcoms):
|
||||||
filelinelist.append(validcomdict)
|
validcomdict = {"comtype": comtype, "validcoms": validcoms}
|
||||||
|
filelinelist.append(validcomdict)
|
||||||
|
currentsuccesslines += 1
|
||||||
|
|
||||||
for atlinefound in filelinelist:
|
if currentsuccesslines:
|
||||||
|
bot.memory['SpiceBot_CommandsQuery']['counts'] += 1
|
||||||
|
|
||||||
dict_from_file = dict()
|
if len(filelinelist):
|
||||||
|
for atlinefound in filelinelist:
|
||||||
|
|
||||||
comtype = atlinefound["comtype"]
|
dict_from_file = dict()
|
||||||
validcoms = atlinefound["validcoms"]
|
|
||||||
|
|
||||||
# default command to filename
|
comtype = atlinefound["comtype"]
|
||||||
if "validcoms" not in dict_from_file.keys():
|
validcoms = atlinefound["validcoms"]
|
||||||
dict_from_file["validcoms"] = validcoms
|
|
||||||
|
|
||||||
maincom = dict_from_file["validcoms"][0]
|
# default command to filename
|
||||||
if len(dict_from_file["validcoms"]) > 1:
|
if "validcoms" not in dict_from_file.keys():
|
||||||
comaliases = spicemanip.main(dict_from_file["validcoms"], '2+', 'list')
|
dict_from_file["validcoms"] = validcoms
|
||||||
else:
|
|
||||||
comaliases = []
|
|
||||||
|
|
||||||
bot.memory['SpiceBot_CommandsQuery']['commands'][comtype][maincom] = dict_from_file
|
maincom = dict_from_file["validcoms"][0]
|
||||||
for comalias in comaliases:
|
if len(dict_from_file["validcoms"]) > 1:
|
||||||
if comalias not in bot.memory['SpiceBot_CommandsQuery']['commands'][comtype].keys():
|
comaliases = spicemanip.main(dict_from_file["validcoms"], '2+', 'list')
|
||||||
bot.memory['SpiceBot_CommandsQuery']['commands'][comtype][comalias] = {"aliasfor": maincom}
|
else:
|
||||||
|
comaliases = []
|
||||||
|
|
||||||
|
bot.memory['SpiceBot_CommandsQuery']['commands'][comtype][maincom] = dict_from_file
|
||||||
|
for comalias in comaliases:
|
||||||
|
if comalias not in bot.memory['SpiceBot_CommandsQuery']['commands'][comtype].keys():
|
||||||
|
bot.memory['SpiceBot_CommandsQuery']['commands'][comtype][comalias] = {"aliasfor": maincom}
|
||||||
|
|
||||||
for comtype in ['module', 'nickname', 'rule']:
|
for comtype in ['module', 'nickname', 'rule']:
|
||||||
bot_logging(bot, 'SpiceBot_CommandsQuery', "Found " + str(len(bot.memory['SpiceBot_CommandsQuery']['commands'][comtype].keys())) + " " + comtype + " commands.", True)
|
bot_logging(bot, 'SpiceBot_CommandsQuery', "Found " + str(len(bot.memory['SpiceBot_CommandsQuery']['commands'][comtype].keys())) + " " + comtype + " commands.", True)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user