diff --git a/middleware.py b/middleware.py index 28ee7ef..ff6f2c1 100644 --- a/middleware.py +++ b/middleware.py @@ -13,8 +13,8 @@ async def __call__( data: Dict[str, Any], ) -> Any: try: - print(event.chat.id) - print(event.message_thread_id) + # print(event.chat.id) + # print(event.message_thread_id) return await handler(event, data) except aiohttp.ClientConnectionError as e: print(f"Error: {e}") @@ -27,13 +27,11 @@ async def __call__( event: Message | CallbackQuery, data: Dict[str, Any], ) -> Any: - if ( - isinstance(event, CallbackQuery) - and event.message - and event.message.chat.type == "private" - ): - return await handler(event, data) - elif isinstance(event, Message) and event.chat.type == "private": - return await handler(event, data) + if isinstance(event, CallbackQuery): + if event.message.chat.type == "private": + return await handler(event, data) + elif isinstance(event, Message): + if event.chat.type == "private": + return await handler(event, data) else: pass