Please support ContextFunc<string> in type of questionText
See original GitHub issueNow questionText
just support string
.
Please support ContextFunc<string>
in type of questionText
too.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@EdJoPaTo I understand what you say and I have faced with this situation in developing my bots in the past years.
So I have a solution for you! I use my Technic to have stateless ability in reply-to-question situation while the question can have dynamic data.😎
My Technic: I generate a unique sign (a random string) and inject it to the
End
orBeginning
of the question.For example:
Step 1
Now we go ahead and hide the sign by this way:
Step 2
Step 3
OK! That’s it…👌 Now we can easily check the sign of question instead of text of question when we have
reply_to_message
:In order to detect its an answer the library currently checks for the
reply_to_message
. It has to have the exact text asquestionText
provided on startup.As this check of the replied message is done on every message coming in it is performance critical.
Also when the result of the function would change between the user hitting the button and the response of the user the library would not be able to detect the users reply at all. the user would be stuck. This is why I chose to prefer an always the same
questionText
.The menu in general uses the
callback_data
which allows this library to be stateless (the only states are from the Telegram and the functions asking or the state (like hide)). Normal Text messages do not allow for this kind of statelessness which makes them feel wrong in the context of this library. 😔