Can I remove one handle in OnMessage?

Hi all,
In the document, only remove all listeners method.

Hi @BlueBang, this lacks documentation indeed.

I assume you're talking about the JavaScript client (colyseus.js). Here's how you can remove the listener:

var callback = (message) => {/* ... */}

// attach listener
room.onMessage(callback);

// remove listener
room.onMessage.remove(callback);

Cheers!

@endel Yes, it is. Haha, Cheers!

onMessage returns function that remove listner:

var removeListner = room.onMessage("powerup", (message) => {
  console.log("message received from server");
  console.log(message);
});

removeListner();