TelegramBots
TelegramBots copied to clipboard
Reply flow execute only 2 flows
trafficstars
According to documentation, Reply flow doesn`t have any constraints of flow chain amount. https://github.com/rubenlagus/TelegramBots/wiki/State-Machines#complete-example
Let's try to use this ReplyFlow, version 6.0.0
ReplyFlow.builder(db)
.action((baseAbilityBot, update) -> silent.send("step 1", getChatId(update)))
.onlyIf(hasMessageWith("/com1"))
.next(Reply.of((baseAbilityBot, update) -> silent.send("step 2", getChatId(update)), hasMessageWith("/com2")))
.next(Reply.of((baseAbilityBot, update) -> silent.send("step 3", getChatId(update)), hasMessageWith("/com3")))
.next(Reply.of((baseAbilityBot, update) -> silent.send("step 4", getChatId(update)), hasMessageWith("/com4")))
.build();
Expected result: All steps works correctly(after entering command to bot, it`s return text(ex. step 1)
Actual result: Only 2 first steps works. Other 2 not executes

In debug i don`t understang 1 things.
- Why my condition with checking existance in Update object message with text "/com3" is false

If don't use .onlyIf() method in builder, works perfectly. I`ll dig more.
