From 189bf2cf852f887fd2426b77b0b6276e31419adc Mon Sep 17 00:00:00 2001 From: Wildan Fathan Date: Wed, 28 Feb 2024 22:47:22 +0700 Subject: [PATCH] Fix documentation to send a chat (#185) --- packages/nakama-js/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nakama-js/README.md b/packages/nakama-js/README.md index acfa3d7..8927869 100644 --- a/packages/nakama-js/README.md +++ b/packages/nakama-js/README.md @@ -141,15 +141,15 @@ socket.onchannelmessage = (message) => { // 1 = room, 2 = Direct Message, 3 = Group -const type : number = 1; const roomname = "mychannel"; -const persistence : boolean = false; -const hidden : boolean = false; +const type: number = 1; +const persistence: boolean = false; +const hidden: boolean = false; -const channel = await socket.joinChat(type, roomname, persistence, hidden); +const channel = await socket.joinChat(roomname, type, persistence, hidden); -const message = { "hello": "world" }; -socket.writeChatMessage(channel.channel.id, message); +const message = { hello: "world" }; +socket.writeChatMessage(channel.id, message); ``` ## Handling errors