Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid restart user conversation on call the start method #99

Closed
andersonba opened this issue Mar 5, 2018 · 0 comments
Closed

avoid restart user conversation on call the start method #99

andersonba opened this issue Mar 5, 2018 · 0 comments
Assignees

Comments

@andersonba
Copy link
Owner

I found this bug when I configured the bot for multiple clients (multi-session).
In my configuration, the start method is called every time when the bot receives a message:

bot.session(sid, { store: storeFromDB(sid) })
  .hear(msg)
  .start();

The bot replies the hear method normally, but the start method dispatches the restart command, making the bot to lost the previous currentIdx.

Found

// store { currentIdx: 2 }
bot.hear(message).start();
// store { currentIdx: 0 }

Expected

// store { currentIdx: 2 }
bot.hear(message).start();
// store { currentIdx: 2 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant