This commit is contained in:
2023-05-08 10:14:28 +03:00
parent 7bca26e07c
commit 38d8674bbd
7 changed files with 18 additions and 18 deletions
+6 -6
View File
@@ -39,7 +39,7 @@ class ModuleV1:
# set environmental variables
def set_env(self):
self.RESPONCE = ""
self.RESPONSE = ""
def set_predefine(self):
try:
@@ -55,7 +55,7 @@ class ModuleV1:
self.MESSAGE = msg
try:
exec(self.code)
return self.RESPONCE
return self.RESPONSE
except Exception as e:
print(f"[ERROR] module v1: module \"{self.path}\" ({self.alias}) raised exception \"{e}\"")
return ""
@@ -197,9 +197,9 @@ def queue_processor():
for mod in mcu.modules:
if mod.enabled:
if mod.version == 1 or mod.version == 2:
responce = mod.process(msg)
if responce:
print(f"Responded using module {mod.path} ({mod.alias}) with text: {responce}")
response = mod.process(msg)
if response:
print(f"Responded using module {mod.path} ({mod.alias}) with text: {response}")
break
del message_queue[0]
@@ -209,7 +209,7 @@ def queue_processor():
else:
time.sleep(1)
except Exception as e:
except Exception:
print(f"[ERROR] queue_processor: current message queue: {message_queue}")
print("[ERROR] queue_processor: error while processing message, trying to delete it...")
try: