From cb05f9d1fa5d07c9ab18e209289d8ad61a6b8805 Mon Sep 17 00:00:00 2001 From: mihalin Date: Fri, 17 Sep 2021 11:16:18 +0300 Subject: [PATCH] fix group chat remove --- server/custom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/custom.py b/server/custom.py index 89e1e1d..8d984e9 100644 --- a/server/custom.py +++ b/server/custom.py @@ -86,8 +86,9 @@ async def receive_left(message: types.Message): _logger.info(f"chat found {chat}") if chat: await bot.group_chats.remove(chat) - _logger.info(f"chat removed {bot.group_chat} {chat}") - if bot.group_chat == chat: + bot_group_chat = await bot.group_chat + _logger.info(f"chat removed {bot_group_chat} {chat}") + if bot_group_chat == chat: _logger.info("saved") bot.group_chat = None await bot.save(update_fields=["group_chat"])