fix voice rooms
This commit is contained in:
@ -25,6 +25,17 @@ class VoiceHub:
|
||||
|
||||
async def broadcast(self, room_id: str, payload: dict):
|
||||
for ws in self.rooms.get(room_id, {}).values():
|
||||
await ws.send_json(payload)
|
||||
try:
|
||||
await ws.send_json(payload)
|
||||
except:
|
||||
pass
|
||||
|
||||
async def broadcast_except(self, room_id: str, except_user: str, payload: dict):
|
||||
for user, ws in self.rooms.get(room_id, {}).items():
|
||||
if user != except_user:
|
||||
try:
|
||||
await ws.send_json(payload)
|
||||
except:
|
||||
pass
|
||||
|
||||
voice_hub = VoiceHub()
|
||||
|
||||
Reference in New Issue
Block a user