When any user come online or when a player leaves,display a text message, so they say hello to eachother and become friends!

there’s no tag for presence.

Hello my name is Eleanor and I’m developing https://www.strawberrypunch.com/ and considering switching to nakama.

I’d like to get started and try to understand how it works and i have a billion questions so i’ll start with something simple.

I want to add presence to the game so when someone comes online it displays a message and when they leave it also displays a message.

That way they can interact and chat even if they don’t necessarily see each other and maybe talk about things and become pals and play together !

here’S the code i have so far:

	socket.onchannelpresence = (presence) => {
		presence.hasOwnProperty("joins") ? runtime.callFunction("addChat",presence.joins[presence.joins.length-1].username + " has joined") : runtime.callFunction("addChat",presence.leaves[presence.leaves.length-1].username+ " has left");
		console.info("Received presence update:", presence);
	};

runtime.callfunction is this
image
“addchat” being the name of the function, to update the text object!