From 4d4d3dfc06213db37f496833e1fe730522323478 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Wed, 16 Aug 2023 19:52:47 +0300 Subject: [PATCH] Update a warning message in dispatcher Enhanced the warning message in aiogram/dispatcher/dispatcher.py to include a JSON dump of the update. This change helps to give clearer and more detailed information on why an update type is unknown by including the specifics of what the update contains. --- aiogram/dispatcher/dispatcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py index f85c91d4..827b300a 100644 --- a/aiogram/dispatcher/dispatcher.py +++ b/aiogram/dispatcher/dispatcher.py @@ -264,7 +264,8 @@ class Dispatcher(Router): warnings.warn( "Detected unknown update type.\n" "Seems like Telegram Bot API was updated and you have " - "installed not latest version of aiogram framework", + "installed not latest version of aiogram framework" + f"\nUpdate: {update.model_dump_json(exclude_unset=True)}", RuntimeWarning, ) raise SkipHandler() from e