Skip to content

Chat ​

Routes user-to-user text through TextChatService TextChannels, as the Roblox chat guidelines require. https://create.roblox.com/docs/chat/guidelines

The server authorizes a message command and grants its sender one message. The sender's client sends the raw text with TextChannel:SendAsync, so TextChatService applies filtering, privacy settings and reporting. ShouldDeliverCallback only delivers granted messages to the granted targets, and receiving clients render the filtered TextChatMessage.Text in the admin UI.

Properties ​

COOLDOWN ​

luau
Chat.COOLDOWN: number

Functions ​

cooldown ​

luau
Chat.cooldown(userId: number, key: string, seconds: number?): string?

Rate limits user-editable text shown to other users, returns a message while cooling down

limitBroadcast ​

luau
Chat.limitBroadcast(userId: number, roleError: string): string?

Gates user text shown to everyone behind a developer role and the shared announcement cooldown

restoreRichText ​

luau
Chat.restoreRichText(text: string, compact: boolean?): string

Restores a safe subset of rich text in text that TextChatService filtered and escaped: b, i, u, s, sc, uc, br, and font with color, transparency and a clamped size. Anything else stays escaped and shows literally. compact is for the chat window and bubbles: font size is dropped and line breaks become spaces. Unbalanced tags would break rich text parsing, so the text is returned unchanged when they don't pair up.

send ​

luau
Chat.send(context: any, kind: string, text: string, targets: { Player }?, data: any?): (string?, string?)

Grants the command's sender one TextChatService message of kind and asks their client to send it. Delivers to everyone in the server, or only to targets through a direct chat channel.

Global commands from another server can't use TextChatService, they are gated and rate limited like announcements by the global command, and their text was filtered in the origin server.

Returns the grant id, or nil and an error message.

limitReason Yields ​

luau
Chat.limitReason(userId: number, reason: string?): string?

Rate limits a free-text reason (ban, kick, shutdown) that other users see. Returns the reason, or nil and notifies the player while it is cooling down.

onMessage ​

luau
Chat.onMessage(kind: string, callback: (text: string, from: number, data: any, id: string) -> ())

Registers the client handler for a message kind, called with the filtered text, sender UserId, data and id

waitForMessage Yields ​

luau
Chat.waitForMessage(id: string, timeout: number?): string?

Waits for the filtered text of a message by id, or nil when it doesn't arrive in time

LABELS ​

announce ​

luau
Chat.LABELS.announce: string

message ​

luau
Chat.LABELS.message: string

hint ​

luau
Chat.LABELS.hint: string

fullmessage ​

luau
Chat.LABELS.fullmessage: string

notify ​

luau
Chat.LABELS.notify: string

privatemessage ​

luau
Chat.LABELS.privatemessage: string

privatehint ​

luau
Chat.LABELS.privatehint: string

vote ​

luau
Chat.LABELS.vote: string

tts ​

luau
Chat.LABELS.tts: string