# broadcastMessage sends to all presences in matchJoin handler

**URL:** <https://forum.heroiclabs.com/t/broadcastmessage-sends-to-all-presences-in-matchjoin-handler/6435>\
**Category:** Runtime Framework\
**Tags:** typescript\
**Created:** [October 22, 2025, 5:04pm UTC](https://forum.heroiclabs.com/t/broadcastmessage-sends-to-all-presences-in-matchjoin-handler/6435 "2025-10-22T17:04:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jeremy/32/2661_2.png) [@jeremy](https://forum.heroiclabs.com/u/jeremy)\
**Post date:** [October 22, 2025, 5:04pm UTC](https://forum.heroiclabs.com/t/broadcastmessage-sends-to-all-presences-in-matchjoin-handler/6435/1 "2025-10-22T17:04:02Z")

</div>

Hello,

I’m using `broadcastMessage` in the `matchJoin` handler to provide the full match state to newly joining presences and a separate `broadcastMessage` (first) to send a bolstered version of presences to all players (so, without the 3rd parameter). The odd thing is both of them seem to be sending the message to all presences regardless of what I provide specify for the 3rd param. Is it because the entries in `presences` param are not technically part of the match yet when the message is sent, and therefore it sends to everyone?

1. Versions: Nakama `3.22.0`, Docker, TS/JS client lib `2.8.0`
2. Server Framework Runtime language: TS/JS

```auto
// inside matchJoin handler

// Broadcast presence updates to all players
dispatcher.broadcastMessage(
  BroadcastOpCodes.Players,
  JSON.stringify(matchState.players),
);

// Broadcast full state to newly joined players
dispatcher.broadcastMessage(
  BroadcastOpCodes.FullState,
  JSON.stringify(matchState),
  presences,
);

```

In this case all participants are receiving both messages.

Any help with this would be appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![jeremy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jeremy/32/2661_2.png) [@jeremy](https://forum.heroiclabs.com/u/jeremy)\
**Post date:** [October 24, 2025, 12:22am UTC](https://forum.heroiclabs.com/t/broadcastmessage-sends-to-all-presences-in-matchjoin-handler/6435/2 "2025-10-24T00:22:19Z")

</div>

Update: this was my own fault. I was sending the same `FullState` broadcast in the `matchLeave` handler (to all presences) as well so it looked the same when testing a player reconnection. This can be deleted/closed/etc.
