From 7e2141097af4d42c2eeb629a7dd9933471f820a8 Mon Sep 17 00:00:00 2001 From: Ilya Shmyrev Date: Wed, 10 Jan 2024 18:26:33 +0500 Subject: [PATCH] Fix --- bot/core/client.py | 3 +++ bot/misc/utils.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/core/client.py b/bot/core/client.py index 921ee46..3697125 100644 --- a/bot/core/client.py +++ b/bot/core/client.py @@ -41,6 +41,9 @@ def __init__(self, server, reader, writer): super().__init__() + def is_closing(self): + return self.__writer.is_closing() + async def send_tag(self, handler_id, *data): tag_data = "|".join(map(str, data)) line = f"[{handler_id}]|{tag_data}|" diff --git a/bot/misc/utils.py b/bot/misc/utils.py index 6972efb..b870b1e 100644 --- a/bot/misc/utils.py +++ b/bot/misc/utils.py @@ -77,7 +77,7 @@ async def get_penguin_from_penguin_id(penguin_id: int) -> Penguin: async def check_connection_to_houdini(): - if server.client_object.__writer.is_closing(): + if server.client_object.is_closing(): await server.connect_to_houdini()