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]
|
||||
|
||||
# check for json reference file
|
||||
validcomdict = botread.module_json_to_dict(str(modulefile))
|
||||
comdict = botread.module_json_to_dict(str(modulefile))
|
||||
|
||||
# replace json defaults
|
||||
validcomdict["filepath"] = str(modulefile)
|
||||
validcomdict["filename"] = str(filename_base)
|
||||
validcomdict["folderpath"] = str(folderpath)
|
||||
validcomdict["foldername"] = str(foldername)
|
||||
comdict["filepath"] = str(modulefile)
|
||||
comdict["filename"] = str(filename_base)
|
||||
comdict["folderpath"] = str(folderpath)
|
||||
comdict["foldername"] = str(foldername)
|
||||
|
||||
detected_lines = []
|
||||
for line in module_file_lines:
|
||||
@ -305,9 +305,8 @@ class BotCommands():
|
||||
if len(detected_lines):
|
||||
|
||||
filelinelist = []
|
||||
currentsuccesslines = 0
|
||||
for detected_line in detected_lines:
|
||||
try:
|
||||
validcomdict = copy.deepcopy(comdict)
|
||||
|
||||
# Commands
|
||||
if str(detected_line).startswith("commands"):
|
||||
@ -333,15 +332,8 @@ class BotCommands():
|
||||
validcomdict["comtype"] = comtype
|
||||
validcomdict["validcoms"] = validcoms
|
||||
filelinelist.append(validcomdict)
|
||||
currentsuccesslines += 1
|
||||
except Exception as e:
|
||||
addnothing = e
|
||||
if addnothing:
|
||||
currentsuccesslines += 0
|
||||
|
||||
if len(filelinelist):
|
||||
for vcomdict in filelinelist:
|
||||
self.register(vcomdict)
|
||||
self.register(validcomdict)
|
||||
|
||||
|
||||
commands = BotCommands()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user