mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
check it
This commit is contained in:
parent
396ff2bdfb
commit
5cca211988
@ -271,13 +271,13 @@ class BotCommands():
|
|||||||
foldername = str(folderpath).split("/")[-1]
|
foldername = str(folderpath).split("/")[-1]
|
||||||
|
|
||||||
# check for json reference file
|
# check for json reference file
|
||||||
validcomdict = botread.module_json_to_dict(str(modulefile))
|
comdict = botread.module_json_to_dict(str(modulefile))
|
||||||
|
|
||||||
# replace json defaults
|
# replace json defaults
|
||||||
validcomdict["filepath"] = str(modulefile)
|
comdict["filepath"] = str(modulefile)
|
||||||
validcomdict["filename"] = str(filename_base)
|
comdict["filename"] = str(filename_base)
|
||||||
validcomdict["folderpath"] = str(folderpath)
|
comdict["folderpath"] = str(folderpath)
|
||||||
validcomdict["foldername"] = str(foldername)
|
comdict["foldername"] = str(foldername)
|
||||||
|
|
||||||
detected_lines = []
|
detected_lines = []
|
||||||
for line in module_file_lines:
|
for line in module_file_lines:
|
||||||
@ -305,9 +305,8 @@ class BotCommands():
|
|||||||
if len(detected_lines):
|
if len(detected_lines):
|
||||||
|
|
||||||
filelinelist = []
|
filelinelist = []
|
||||||
currentsuccesslines = 0
|
|
||||||
for detected_line in detected_lines:
|
for detected_line in detected_lines:
|
||||||
try:
|
validcomdict = copy.deepcopy(comdict)
|
||||||
|
|
||||||
# Commands
|
# Commands
|
||||||
if str(detected_line).startswith("commands"):
|
if str(detected_line).startswith("commands"):
|
||||||
@ -333,15 +332,8 @@ class BotCommands():
|
|||||||
validcomdict["comtype"] = comtype
|
validcomdict["comtype"] = comtype
|
||||||
validcomdict["validcoms"] = validcoms
|
validcomdict["validcoms"] = validcoms
|
||||||
filelinelist.append(validcomdict)
|
filelinelist.append(validcomdict)
|
||||||
currentsuccesslines += 1
|
|
||||||
except Exception as e:
|
|
||||||
addnothing = e
|
|
||||||
if addnothing:
|
|
||||||
currentsuccesslines += 0
|
|
||||||
|
|
||||||
if len(filelinelist):
|
self.register(validcomdict)
|
||||||
for vcomdict in filelinelist:
|
|
||||||
self.register(vcomdict)
|
|
||||||
|
|
||||||
|
|
||||||
commands = BotCommands()
|
commands = BotCommands()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user