> For the complete documentation index, see [llms.txt](https://zumo.fusion.ac/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zumo.fusion.ac/documentation/guides/lobby-feed.md).

# Lobby feed

Lobby bots publish join/leave, chat, locraw, and bot lifecycle events through Zed. Subscribe on namespace `/` with the Socket.IO event name.

## Envelope

Every lobby fan-out includes:

| Field       | Type   | Description                  |
| ----------- | ------ | ---------------------------- |
| `botId`     | string | Producer id, e.g. `duels-1`  |
| `mode`      | string | Game mode slug, e.g. `duels` |
| `lobbyId`   | number | Hypixel lobby number         |
| `timestamp` | number | Unix seconds                 |
| `category`  | string | Usually `lobby`              |

## Core events

| Event                    | Meaning                                   |
| ------------------------ | ----------------------------------------- |
| `playerJoined`           | Player entered lobby                      |
| `playerLeft`             | Player left (verified after grace period) |
| `chat`                   | Structured player chat                    |
| `rawMessage`             | Raw lobby chat line                       |
| `locrawResponse`         | `/locraw` JSON                            |
| `gameJoin`               | Bot game-join cycle                       |
| `disconnected` / `error` | Bot disconnect / error                    |

Full field tables live under [Lobby events](https://app.gitbook.com/s/M9ty6FYa3j98VSBHF9LN/ws/lobby/player-joined) in the API reference.

## Example

```js
socket.on('playerJoined', (data) => {
  console.log(`[${data.mode}#${data.lobbyId}] +${data.username}`);
});

socket.on('chat', (data) => {
  console.log(`${data.prefix}${data.username}: ${data.message}`);
});
```

{% hint style="info" %}
Join/leave uses a \~10s verify window so NPC-adjacent flapping does not emit spurious pairs.
{% endhint %}
