Bot loop when use Stealth(1.1.6) and stealth-facebook(0.13.1)
luizcarvalho opened this issue · comments
Hello friends,
I'm trying Stealth 1.1.6
with stealth-facebook 1.13.1
and bot entered in loop, because of the reads_event
(sorry for that, my fault).
The error occurs because Stealth understand that reads_events
is a message, so, it send a "hello message" again, and when user views the message, Stealth receive reads_event
again and...
We can solve this if a little verification, like this, in BotController
class BotController < Stealth::Controller
helper :all
def route
if @current_message.message
if current_session.present?
step_to session: current_session
else
step_to flow: 'hello', state: 'say_hello'
end
end
end
end