mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-07-05 17:32:02 +02:00
enhance
This commit is contained in:
+13
-7
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user