update group chat name

This commit is contained in:
mihalin 2021-09-17 11:49:48 +03:00
parent 9f32edd1be
commit 709a021c79

View File

@ -74,6 +74,7 @@ async def receive_invite(message: types.Message):
chat, _ = await GroupChat.get_or_create(chat_id=message.chat.id, chat, _ = await GroupChat.get_or_create(chat_id=message.chat.id,
defaults={"name": message.chat.full_name}) defaults={"name": message.chat.full_name})
chat.name = message.chat.full_name chat.name = message.chat.full_name
await chat.save()
if chat not in await bot.group_chats.all(): if chat not in await bot.group_chats.all():
await bot.group_chats.add(chat) await bot.group_chats.add(chat)
await bot.save() await bot.save()