I do a message filter in the Telegram bot. Faced such a problem.
I have the following:слова_и_фразы = ["слово0 слово1", "слово2", ("слово3" || "слово4") && ("слово5" || "слово6" || "слово7")]
I need to find a word or words in the incoming line.
I do the following:написанная_фраза.ИндексОф(слова_и_фразы[цикл] != -1) {console.log("Успешно")}
if I write bot - "слово0 слово1" - all is well
if I write bot - "слово0 слово2" - all is well
if I write bot - "слово3 слово6" or "слово6 слово3" - bad
the bot responds to слово3 , while ignoring the condition
I'm new, do not scold too much
How do you tell me?