A network interceptor that gives flexible control over the chat feature of the game. This also allows for custom commands to be added.
Example
const chat = new VOXELIZE.Chat();
// Listen to incoming chat messages.
chat.onChat = (chat: ChatMessage) => {
console.log(chat);
};
// Sending a chat message.
chat.send({
type: "CLIENT",
sender: "Mr. Robot",
body: "Hello world!",
});
// Register to the network.
network.register(chat);

Type parameters
| Name | Type |
|---|---|
T | extends ChatProtocol = ChatProtocol |
Implements
Constructors
constructor
• new Chat<T>(): Chat<T>
Type parameters
| Name | Type |
|---|---|
T | extends ChatProtocol = ChatProtocol |
Returns
Chat<T>
Properties
onChat
• onChat: (chat: T) => void