This commit is contained in:
2023-10-13 19:45:30 +03:00
parent 1c46fc1d48
commit 84e6841331
8 changed files with 84 additions and 73 deletions

View File

@@ -20,10 +20,11 @@ async def update_chat(_, info, chat_new):
"""
author_id = info.context["author_id"]
chat_id = chat_new["id"]
chat = await redis.execute("GET", f"chats/{chat_id}")
chat = (await redis.execute("GET", f"chats/{chat_id}"))
if not chat:
return {"error": "chat not exist"}
chat = dict(json.loads(chat))
else:
chat = json.loads(chat)
if author_id in chat["admins"]:
chat.update(