TextChatService

Show Deprecated
Not Creatable
Service

A service handling in-experience text chat. TextChatService handles various text chat related tasks, such as managing channels, decorating messages, filtering text, creating commands, and developing custom chats interfaces.

To learn more about using TextChatService, see In-Experience Text Chat.

Summary

Properties

Determines whether to fully enable TextChatService or revert to the legacy chat system.

Determines whether TextChatService should create default TextChatCommands.

Determines whether TextChatService should create default TextChannels.

Methods

DisplayBubble(partOrCharacter: Instance, message: string): void  

Displays a chat bubble above the provided part or character.

CanUserChatAsync(userId: number): boolean  YIELDS


CanUsersChatAsync(userIdFrom: number, userIdTo: number): boolean  YIELDS


Events

BubbleDisplayed(partOrCharacter: Instance, textChatMessage: TextChatMessage): RBXScriptSignal  

Fires when TextChatService:DisplayBubble() is called.


Fires when a TextChannel:SendAsync() response is received by the server or TextChannel:DisplaySystemMessage() is invoked.


Fires when TextChannel:SendAsync() is called by the sending client.

Callbacks

Properties

ChatTranslationEnabled

Roblox Script Security

ChatTranslationToggleEnabled

Roblox Script Security

ChatVersion

Not Accessible Security

Determines whether TextChatService should be fully enabled or to allow the legacy chat system. Setting to this property to ChatVersion.LegacyChatService effectively disables TextChatService.

CreateDefaultCommands

Plugin Security

Determines whether TextChatService should create default TextChatCommands.

If true, the following TextChatCommands are created and put in a Folder named TextChatCommands inside TextChatService:

NamePrimaryAliasSecondaryAliasDescriptionUsage Example
RBXConsoleCommandconsoleOpens the Developer Console.\console
RBXEmoteCommandemoteePlays avatar emote.\e dance
RBXHelpCommandhelp?Shows a list of chat commands.\help
RBXMuteCommandmutemMutes a user by user's Player.Name or Player.DisplayName in all TextChannels.\m Username
RBXUnmuteCommandunmuteumUnmutes a user by user's Player.Name or Player.DisplayName in all TextChannels.\um Username
RBXVersionCommandversionvShows the chat version.\version

Developers can edit, create, and remove TextChatCommands as even if TextChatService.CreateDefaultCommands is true.

Mute and unmute commands apply to all TextChannels.

CreateDefaultTextChannels

Plugin Security

Determines whether TextChatService should create default TextChannels.

If true, Team based TextChannels are automatically created (and removed when Teams are removed), along with the following TextChannels in a Folder named TextChannels inside TextChatService:

NameDescription
RBXGeneralFor all messages.
RBXSystemFor system messages.
RBXTeam<BrickColor.Name>For team messages. Name of the TextChannel is the string "RBXTeam" followed by the name of Team.BrickColor. (Ex: "RBXTeamNavy blue" for a team with "Navy blue" BrickColor)

If false, Team based TextChannels are not automatically created and destroyed.

Developers can edit, create, and remove TextChannels even if TextChatService.CreateDefaultTextChannels is true.

Methods

DisplayBubble

void

Displays a chat bubble above the provided partOrCharacter. Can display bubbles for non-player characters (NPCs).

Fires the TextChatService.BubbleDisplayed event with the parameters specified in this method.

Parameters

partOrCharacter: Instance

The part or character that the bubble to be displayed above.

message: string

The text to be displayed in the chat bubble.


Returns

void

CanUserChatAsync

Yields

Parameters

userId: number

Returns

CanUsersChatAsync

Yields

Parameters

userIdFrom: number
userIdTo: number

Returns

Events

BubbleDisplayed

Fires when TextChatService:DisplayBubble() is called.

Parameters

partOrCharacter: Instance
textChatMessage: TextChatMessage

MessageReceived

Only fired on the receiving client. when TextChannel:SendAsync() response is received by the server or TextChannel:DisplaySystemMessage() is invoked.

Use TextChatMessage parameter to get the TextSource and the text of the message (with TextChatMessage.Text).

The TextChatMessage parameter is the final result of any functions bound to TextChatMessage.OnIncomingMessage.

Parameters

textChatMessage: TextChatMessage

The received TextChatMessage.


SendingMessage

Only fired on the sending client when TextChannel:SendAsync() is called by the sending client.

Use this to allow placeholder messages to be shown to the user while waiting for server response to TextChannel:SendAsync().

Parameters

textChatMessage: TextChatMessage

Callbacks

OnBubbleAdded

Parameters

adornee: Instance

Returns

OnIncomingMessage

Parameters


Returns