fix group chat remove

This commit is contained in:
mihalin 2021-09-17 11:16:18 +03:00
parent 05b2c05fba
commit cb05f9d1fa

View File

@ -86,8 +86,9 @@ async def receive_left(message: types.Message):
_logger.info(f"chat found {chat}") _logger.info(f"chat found {chat}")
if chat: if chat:
await bot.group_chats.remove(chat) await bot.group_chats.remove(chat)
_logger.info(f"chat removed {bot.group_chat} {chat}") bot_group_chat = await bot.group_chat
if bot.group_chat == chat: _logger.info(f"chat removed {bot_group_chat} {chat}")
if bot_group_chat == chat:
_logger.info("saved") _logger.info("saved")
bot.group_chat = None bot.group_chat = None
await bot.save(update_fields=["group_chat"]) await bot.save(update_fields=["group_chat"])