W
W
Werner Heisenberg2021-05-05 15:00:11
Java
Werner Heisenberg, 2021-05-05 15:00:11

How to write an algorithm in java so that the bot would respond to 3 identical questions that are asked one after another?

I am writing a simple bot in java and aiml. When writing and running a bot in telegram, the bot does not respond to the same questions that are asked one after another. And in the console version, it reacts thanks to the REPETITIONDETECTED pattern. I do not know what it is connected with. So, you can write a separate script in java, so that after 3 identical spam messages it would notice and answer them with some phrase?
In one screenshot, the console version, where everything works.
On the other version for telegram, where nothing works.
609288222d162369573260.png
60928836590d2437667586.png
If possible, please write the code!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
etozhesano, 2021-05-05
@etozhesano

Do you want him to respond differently to the same message?
Make some kind of counter that will be i++ when spamming. Attach your answer to each i (well, or other business logic). Do not forget about the reset condition (for example, if "spam" ended with a change in another phrase or by time, etc.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question