Skip to main content

escapeText

Escapes special characters in a message so that they are displayed correctly in the chat.

This method can be used to prevent players from injecting malicious code into messages or to ensure that messages are displayed as intended.

Syntax

engine.chat.escapeText(text);

Parameters

NameTypeDescription
textstringThe message to escape

Example

engine.chat.escape('My unescaped {} message');

// results in "My unescaped || message"

Available on: Client Server