-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Updates should be handled only once #84
Comments
Hello again! I'm aware of this issue, but I think it's okay to stream every message into the Maybe I need to brainstorm a little more. Thanks again for sharing the idea. |
Sure, the blocking bot.start isn't the real issue I think that probably what should be done is handling just the first one, by the order in which they are inserted. For example:
if the text is "/help", only the help handler should handle the update.
in this case, if the text is "/help", only the onMessage handler should handle the update (as it is the first one that matches) I don't know if this is what you want, but i think that this is probably the behavior that should happen. Let me know please. |
Yeah yeah, I understand. I'm aware of this issue for a while now. But, in my opinion, the different stream getters are only to be used when users intentionally want to listen to all the updates. If they want to add more specificity to the receiving updates, Televerse provides a ton of methods, such as On another note, users can simply use the That being said, I'd say the getters such as I will surely look for ways to eliminate this in future releases. Thank you so much for reporting this. Also, I look forward to talking with you in our group chat over Telegram if you're interested. You can join the group here: https://t.me/TeleverseDart. |
Hey, just wanted to update this behavior is implemented to Televerse now only relies on the As part of this change, I had to completely remove the Thanks again for suggesting this :) |
Well, I'm not sure of the bugs lying inside the current structure. If you're able to catch some, please do shoot it :) Thanks! Happy Televersing <3 |
At the moment, in a situation like this:
The update will be handled both by onMessage and help, and this probably shouldn't be the case (But as the updates are listened from an "update stream" this behavior maybe is wanted), but could at least be deactivated
IF THE BEHAVIOR ISN'T WANTED, you should refactor the code, by removing the updates stream, and instead, in the "start" function, you should listen to the long polling, and if you receive the updates, you should iter in each handler, and as soon one handler's filters match, you should run it and then break the for loop
PLUS, i suggest, if you do those modifications, you should make the "start" function blocking by using an await for while waiting for updates, as a long polling function should be blocking.
The text was updated successfully, but these errors were encountered: