mirror of
https://github.com/OHV-IT/collabrix.git
synced 2025-12-15 16:48:36 +01:00
18 lines
471 B
Python
18 lines
471 B
Python
import asyncio
|
|
from app.websocket import manager
|
|
|
|
async def main():
|
|
msg = {
|
|
"type": "read_marker",
|
|
"user_id": 42,
|
|
"channel_id": 4,
|
|
"last_seen": "2025-12-12T13:30:00Z",
|
|
}
|
|
# Broadcast to channel and presence (0)
|
|
await manager.broadcast_to_channel(msg, 4)
|
|
await manager.broadcast_to_channel({**msg, "type": "read_marker"}, 0)
|
|
print('Simulated broadcast sent:', msg)
|
|
|
|
if __name__ == '__main__':
|
|
asyncio.run(main())
|