From 4591906209fe3d19717b753707b1b1e716024a15 Mon Sep 17 00:00:00 2001 From: DanZ-ix Date: Sun, 5 May 2024 23:24:47 +0300 Subject: [PATCH] Added message serialisation and deserialization block in 2.x -> 3.x migration guide --- CHANGES/1412.doc.rst | 1 + docs/migration_2_to_3.rst | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 CHANGES/1412.doc.rst diff --git a/CHANGES/1412.doc.rst b/CHANGES/1412.doc.rst new file mode 100644 index 00000000..e9ca6d14 --- /dev/null +++ b/CHANGES/1412.doc.rst @@ -0,0 +1 @@ +Added message serialisation and deserialization block in 2.x -> 3.x migration guide diff --git a/docs/migration_2_to_3.rst b/docs/migration_2_to_3.rst index 0eeef2bf..df966c36 100644 --- a/docs/migration_2_to_3.rst +++ b/docs/migration_2_to_3.rst @@ -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 `_ models.