This commit is contained in:
2023-10-04 01:54:52 +03:00
parent 04c0f3d6e7
commit f8b00cc1b4
6 changed files with 17 additions and 11 deletions

View File

@@ -54,9 +54,10 @@ async def create_message(_, info, chat: str, body: str, reply_to=None):
# subscribe on updates
channel_name = (
f"private:{author_id}" if not chat["title"] else f"group:{chat['id']}"
f"chat:{chat['id']}" if not chat["title"] else f"group:{chat['id']}"
)
redis.execute("PUBLISH", channel_name, json.dumps(new_message))
new_message["kind"] = "new_message"
await redis.execute_pubsub("PUBLISH", channel_name, json.dumps(new_message))
return {"message": new_message, "error": None}