diff --git a/main.py b/main.py index f98d8d4..ba08092 100644 --- a/main.py +++ b/main.py @@ -38,7 +38,7 @@ class ModuleV1: # set environmental variables def set_env(self): - self.RESPONCE = "" + self.RESPONSE = "" def set_predefine(self): try: @@ -54,7 +54,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 "" @@ -72,8 +72,7 @@ class ModuleV2: # running the module def process(self, msg): try: - response = self.obj.process(msg, self.path) - return response + return self.obj.process(msg, self.path) except Exception as e: print(f"[ERROR] module v2: module \"{self.path}\" ({self.alias}) raised exception \"{e}\"") return None @@ -189,9 +188,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: - updater.bot.send_message(chat_id=msg.chat.id, text=responce, + response = mod.process(msg) + if response: + updater.bot.send_message(chat_id=msg.chat.id, text=response, disable_web_page_preview=True) print(f"Responded using module {mod.path} ({mod.alias}) with text: {responce}") break