-
Notifications
You must be signed in to change notification settings - Fork 172
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
[async] Upgrading to python-telegram-bot ^20 ? #45
Comments
It's great question! The main problem is to rewrite I'm not Professional python developer, but it was a great and not such difficult experience P.S. yep, it's fully async, so handlers need to be async/awaited |
Thanks for your answer! Could you show the code? I added https://gist.github.com/SergSm/68783e59720afdd57114a179fdd835ab It works somehow but I think that I misunderstand something and I don’t have to run bot in a separate webserver process. Is there another way to trigger bot without need for running a separate webserver process? |
I found the way to serve external requests by running uvicorn programatically in the same async context like that: async with application_tg:
await application_tg.start()
await server.serve() # uvicorn
await application_tg.stop() In addition to the said above: |
Please make PR with ideas! Should be useful for the community |
To make this work we need to wait at least django 4.2 to be released since Django ORM is still only sync. Also the new PTB 20 has new backward incompatible syntax and still not have a stable release |
Maybe.. |
PTB v20.0 was released a few days ago! |
Any news about updating to PTB and Django 4.2 or 5 versions? |
It would be nice to rewrite the template according to a new python-telegram-bot ^20.
The new 20x version of python-telegram-bot is fully asynchronous
The text was updated successfully, but these errors were encountered: