Изменил вебсокет
This commit is contained in:
parent
a2e34ee619
commit
f7e3b333ba
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ class ConnectionManager(WebSocket):
|
|||
async def broadcast(self, user_id: int, chat_id: int, message: str):
|
||||
await self.add_message_to_database(user_id=user_id, chat_id=chat_id, message=message)
|
||||
for websocket in self.active_connections[chat_id]:
|
||||
await websocket.send_text(message)
|
||||
await websocket.send_text(f'{"message": {message}}')
|
||||
|
||||
@staticmethod
|
||||
async def add_message_to_database(user_id: int, chat_id: int, message: str):
|
||||
|
|
Loading…
Add table
Reference in a new issue