This commit is contained in:
SpudGunMan
2025-10-14 12:24:42 -07:00
parent 0f2061af55
commit 9d9f070908
+13 -7
View File
@@ -145,13 +145,19 @@ def checkVoxTrapWords(text):
trap_lower = trap_clean.lower()
idx = text_lower.find(trap_lower)
if idx != -1:
# Remove everything before and including the trap word
new_text = text[idx + len(trap_clean):].strip()
words = new_text.lower().split()
for word in words:
if word in botMethods:
logger.debug(f"RadioMon: VOX found bot method '{word}' in new_text '{new_text}', calling with '{new_text}'")
return botMethods[word]()
if voxEnableCmd:
# Remove everything before and including the trap word
new_text = text[idx + len(trap_clean):].strip()
words = new_text.lower().split()
for word in words:
if word in botMethods:
logger.debug(f"RadioMon: VOX found bot method '{word}' in new_text '{new_text}', calling with '{new_text}'")
return botMethods[word]()
else:
# we go voxTrapList only, just return the text after the trap word
new_text = text[idx + len(trap_clean):].strip()
logger.debug(f"RadioMon: VOX detected trap word '{trap_lower}' in: '{text}'")
return new_text
return None
except Exception as e:
logger.debug(f"RadioMon: Error in checkVoxTrapWords: {e}")