Add serialization utilities and update documentation (#1515)

* Add serialization utilities and update documentation

Introduced utilities to deserialize Telegram objects to JSON-compliant Python objects and vice versa. These utilities manage both cases with and without files. The documentation has been updated to reflect these changes, including updates in migration recommendations and tutorials. A new unit test is added to verify the new functionality.

* Fixed Must-die implementation of the datetime serialization

* Fixed `TypeError: can't subtract offset-naive and offset-aware datetimes`
This commit is contained in:
Alex Root Junior 2024-06-19 00:54:36 +03:00 committed by GitHub
parent 1f7bbeb355
commit 1888039cee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 213 additions and 10 deletions

2
CHANGES/1450.feature.rst Normal file
View file

@ -0,0 +1,2 @@
Added utility to safely deserialize any Telegram object or method to a JSON-compatible object (dict).
(:ref:`>> Read more <serialization-tool>`)