# Nakama realtime chat documentation seems out of sync with latest changes

**URL:** <https://forum.heroiclabs.com/t/nakama-realtime-chat-documentation-seems-out-of-sync-with-latest-changes/5672>\
**Category:** Documentation\
**Created:** [September 25, 2024, 1:43am UTC](https://forum.heroiclabs.com/t/nakama-realtime-chat-documentation-seems-out-of-sync-with-latest-changes/5672 "2024-09-25T01:43:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisYoo](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@ChrisYoo](https://forum.heroiclabs.com/u/ChrisYoo)\
**Post date:** [September 25, 2024, 1:43am UTC](https://forum.heroiclabs.com/t/nakama-realtime-chat-documentation-seems-out-of-sync-with-latest-changes/5672/1 "2024-09-25T01:43:23Z")

</div>

## **Issue #1**

Go here:

> **[Real-time Chat](https://heroiclabs.com/docs/nakama/concepts/chat/)**
>
> Enable community interaction via direct, group, or public chat channels. Allows users to browse and join their desired chats, or create new ones. Messages in these channels can be persistent, enabling offline users to review them later, or visible to...

and change the dropdowns at the top of the page to “Defold” and “Lua”

Scroll down to the Rooms section and you will see this code:

```auto
local roomname = "MarvelMovieFans"
local persistence = true
local hidden = false

local channel = socket.channel_join(roomname, socket.CHANNELTYPE_ROOM, persistence, hidden)

print("Now connected to channel id: " .. channel.id);

```

The problem is you will be using the channel.id here to send a chat message later, and this syntax is incorrect. `socket.channel_join` returns a table with channel as a nested table inside it, so the correct syntax is:

`print("Now connected to channel id: " .. channel.channel.id);`

* * *

## **Issue #2**

If you specify a roomname, it will _not_ be the channel\_id. The actual channel\_id that must be used, as discovered by inspecting what `socket.channel_join` returns, ends up being something like `2...roomname`. It appears it was not always this way because I found documentation online on github (not Heroic related) where using the `roomname` by itself worked as the channel\_id, which is much more intuitive. I assume there’s a reason this changed but does anyone know why or where?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [September 25, 2024, 4:14pm UTC](https://forum.heroiclabs.com/t/nakama-realtime-chat-documentation-seems-out-of-sync-with-latest-changes/5672/2 "2024-09-25T16:14:30Z")

</div>

Hello @ChrisYoo,

Thank you for the feedback on Issue #1 (cc @HeroicNathan please correct the docs when possible).

On Issue #2, as far as I’m aware, it’s always been the case that you need to a channel\_id returned by `channel_join` even for rooms. If you’ve found documentation that states otherwise it’s likely incorrect.

Best.

---

<div class="post-metadata">

**Author:** ![ChrisYoo](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@ChrisYoo](https://forum.heroiclabs.com/u/ChrisYoo)\
**Post date:** [September 25, 2024, 8:56pm UTC](https://forum.heroiclabs.com/t/nakama-realtime-chat-documentation-seems-out-of-sync-with-latest-changes/5672/3 "2024-09-25T20:56:03Z")

</div>

Further down on the same page as the original post there is this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/heroiclabs/original/2X/e/eea399b1c7190c57e7d01388dc432f2d5c0eab10.png)  
Which uses “channel\_id” defined earlier, not using the result of socket messages, which can add prefixes to the channel\_id.

I’m not sure honestly if it’s the defold-nakama wrapper messing this part up by altering the channel id or not. I’m a newbie to all this.
