Added message serialisation and deserialization block in 2.x -> 3.x migration guide

This commit is contained in:
DanZ-ix 2024-05-05 23:24:47 +03:00
parent 6d655330af
commit 4591906209
2 changed files with 9 additions and 0 deletions

1
CHANGES/1412.doc.rst Normal file
View file

@ -0,0 +1 @@
Added message serialisation and deserialization block in 2.x -> 3.x migration guide

View file

@ -149,3 +149,11 @@ Telegram API Server
- The `server` parameter has been moved from the `Bot` instance to `api` in `BaseSession`.
- The constant `aiogram.bot.api.TELEGRAM_PRODUCTION` has been moved to `aiogram.client.telegram.PRODUCTION`.
Message serialisation and deserialization
===========================================
- Method :class:`Message.to_object()` and :class:`Message.to_json()` have been removed. :class:`Message.model_dump()` should be used
instead of :class:`Message.to_object()` and :class:`Message.model_dump_json()` instead of :class:`Message.to_json` due
to use of `pydantic <https://docs.pydantic.dev/>`_ models.