-
Hi, I will imagine and create a demo situation by replacing my existing names to explain the issue I am currently facing and not finding a solution for it. I will leave a concept similar. ProblemMy bot needs to always (almost) check whether the user pasted a car name that is being validated outside (in another file). It can be pasted anytime randomly and I want it to handle it. It's one of the entry points, so the user can jump to the Conversation Handler anytime by pasting the car name. It fails when:
Code
What have I tried?
And some other methods that I cannot remember now. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
By the way, my real-life case is that I want to allow users either to go through the full path by clicking buttons: Start -> Car -> Get Info By Car Name -> Provide Car Name -> Get Info From Bot or just paste the car name and get information about it immediately if user wants. This makes user experience better. |
Beta Was this translation helpful? Give feedback.
-
With allow_entry=True, the entry points are currently checked before the current states handlers are checked. This is already tracked as improvement topic in #2770. |
Beta Was this translation helpful? Give feedback.
Until there is a fix for this, I temporarily edited the conversationhandler.py code on lines 780 to 809.
if
(line 781) with anotherif
(line 793) places to first check for states, not entry points.if state is None or self.allow_reentry:
(line 781) toif (state is None or self.allow_reentry) and handler is None:
.else: return None
(line 808) because we want to move to entry points if we don't find the stage or fallback needed.Whoever will face the same issue and read this, use this workaround at your own risk. Also, there is a smarter way by rewriting this part of the code but I already spent more than needed time on this particular…