From e3d579fa0238effc95bb6d653b2b04885661e827 Mon Sep 17 00:00:00 2001 From: mihalin Date: Thu, 16 Jun 2022 03:53:19 +0300 Subject: [PATCH] edited message handler experimental --- server/custom.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/server/custom.py b/server/custom.py index 5a32a54..2f20fb1 100644 --- a/server/custom.py +++ b/server/custom.py @@ -276,15 +276,18 @@ class CustomRequestHandler(WebhookRequestHandler): db_bot_instance.set(bot) dp = Dispatcher(AioBot(bot.decrypted_token())) - dp.register_message_handler(message_handler, content_types=[types.ContentType.TEXT, - types.ContentType.CONTACT, - types.ContentType.ANIMATION, - types.ContentType.AUDIO, - types.ContentType.DOCUMENT, - types.ContentType.PHOTO, - types.ContentType.STICKER, - types.ContentType.VIDEO, - types.ContentType.VOICE]) + supported_messages = [types.ContentType.TEXT, + types.ContentType.CONTACT, + types.ContentType.ANIMATION, + types.ContentType.AUDIO, + types.ContentType.DOCUMENT, + types.ContentType.PHOTO, + types.ContentType.STICKER, + types.ContentType.VIDEO, + types.ContentType.VOICE] + dp.register_message_handler(message_handler, content_types=supported_messages) + dp.register_edited_message_handler(message_handler, content_types=supported_messages) + dp.register_message_handler(receive_invite, content_types=[types.ContentType.NEW_CHAT_MEMBERS]) dp.register_message_handler(receive_left, content_types=[types.ContentType.LEFT_CHAT_MEMBER]) dp.register_message_handler(receive_migrate, content_types=[types.ContentType.MIGRATE_TO_CHAT_ID])