# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: TextChatMessage type: class memory_category: Instances summary: | A data object representing a text chat message. description: | A data object representing a text chat message. To learn more about using TextChatMessages, see [In-Experience Text Chat](../../../chat/in-experience-text-chat.md). code_samples: [] inherits: - Instance descendants: [] tags: - NotCreatable deprecation_message: '' properties: - name: TextChatMessage.BubbleChatMessageProperties summary: '' description: '' code_samples: [] type: BubbleChatMessageProperties tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: - Chat - name: TextChatMessage.ChatWindowMessageProperties summary: '' description: '' code_samples: [] type: ChatWindowMessageProperties tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: - Chat - name: TextChatMessage.MessageId summary: | A unique identifier for the `Class.TextChatMessage`. description: | A unique identifier for the `Class.TextChatMessage`. code_samples: [] type: string tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: - Chat - name: TextChatMessage.Metadata summary: | A general purpose field for storing miscellaneous data about the `Class.TextChatMessage`. description: | A general purpose field for storing miscellaneous data about the `TextChatMessage`. The second argument of `Class.TextChannel:SendAsync()` and `Class.TextChannel:DisplaySystemMessage()` is used to populate this field. Use this field to apply additional formatting for special messages within `Class.TextChatService.OnIncomingMessage` and `Class.TextChannel.OnIncomingMessage` callbacks. ``` local TextChatService = game:GetService("TextChatService") local generalChannel: TextChannel = TextChatService:WaitForChild("TextChannels").RBXGeneral generalChannel:DisplaySystemMessage("This is an error!", "Game.Error.Generic") generalChannel:DisplaySystemMessage("Could not find save data!", "Game.Error.SaveDataNotFound") generalChannel:DisplaySystemMessage("You won the game!", "Game.Info.Win") generalChannel:DisplaySystemMessage("You lost the game!", "Game.Info.Lose") generalChannel.OnIncomingMessage = function(message: TextChatMessage) if string.find(message.Metadata, "Error") then local overrideProperties = Instance.new("TextChatMessageProperties") overrideProperties.TextColor = Color3.fromRGB(255, 0, 0) return overrideProperties elseif string.find(message.Metadata, "Info") then local overrideProperties = Instance.new("TextChatMessageProperties") overrideProperties.TextColor = Color3.fromRGB(0, 255, 150) return overrideProperties end return nil end ``` As follows is a reference of the default system messages emitted by the chat system:
| Metadata | Description |
|---|---|
Roblox.ChatTranslation.ChatWindow.SystemMessage |
Indicates that the system may translate chat messages for the player. |
Roblox.Notification.Friend.Joined |
Displayed when one of the player's connections join the experience. |
Roblox.MessageStatus.Warning.Floodchecked |
Displayed when the player's sent message was rate limited by the server. |
Roblox.MessageStatus.Warning.TextFilterFailed |
Displayed when the player's sent message could not be displayed due to a text filtering issue. |
Roblox.MessageStatus.Warning.InvalidPrivacySettings |
Displayed when the player's privacy settings prevent them from sending a message. |
Roblox.MessageStatus.Warning.MessageTooLong |
Displayed when the player sends a message with content that is too long. |
Roblox.MessageStatus.Warning.Unknown |
Displays when the system fails to send the player's message for an unknown reason. |
Roblox.Help.Info |
Displays the response from the RBXHelpCommand Class.TextChatCommand. |
Roblox.Version.Info |
Displays the response from the RBXVersionCommand Class.TextChatCommand. |
Roblox.Team.Success.NowInTeam |
Displayed when the player's team changes. |
Roblox.Team.Error.CannotTeamChatIfNotInTeam |
Displayed when the player triggers the RBXTeamCommand Class.TextChatCommand without being on a Class.Team. |
Roblox.Whisper.Info.Success |
Displayed when the player successfully starts a whisper conversation. |
Roblox.Whisper.Welcome.Sent |
Displayed when entering a whisper Class.TextChannel. |
Roblox.Whisper.Error.CannotWhisperToSelf |
An error response from the RBXWhisperCommand Class.TextChatCommand. |
Roblox.Whisper.Error.TargetDoesNotExist |
An error response from the RBXWhisperCommand Class.TextChatCommand. |
Roblox.Whisper.Error.TooManyMatches |
An error response from the RBXWhisperCommand Class.TextChatCommand. |
Roblox.Whisper.Error.Unknown |
An error response from the RBXWhisperCommand Class.TextChatCommand. |
Roblox.Emote.Error.DoesNotExist |
An error response from the RBXEmoteCommand Class.TextChatCommand. |
Roblox.Emote.Error.UserEmotesNotEnabled |
An error response from the RBXEmoteCommand Class.TextChatCommand. |
Roblox.Emote.Error.TemporarilyUnavailable |
An error response from the RBXEmoteCommand Class.TextChatCommand. |
Roblox.Emote.Error.NotSupported |
An error response from the RBXEmoteCommand Class.TextChatCommand. |
Roblox.Emote.Error.SwitchToR15 |
An error response from the RBXEmoteCommand Class.TextChatCommand. |
Roblox.Emote.Error.AnimationPlaying |
An error response from the RBXEmoteCommand Class.TextChatCommand. |
Roblox.Mute.Error.PlayerNotFound |
An error response from the RBXMuteCommand Class.TextChatCommand. |
Roblox.Mute.Error.MultipleMatches |
An error response from the RBXMuteCommand Class.TextChatCommand. |
Roblox.Mute.Error.CannotMuteSelf |
An error response from the RBXMuteCommand Class.TextChatCommand. |
Roblox.Mute.Info.Success |
An success response from the RBXMuteCommand Class.TextChatCommand. |
Roblox.Unmute.Error.PlayerNotFound |
An error response from the RBXUnmuteCommand Class.TextChatCommand. |
Roblox.Unmute.Error.MultipleMatches |
An error response from the RBXUnmuteCommand Class.TextChatCommand. |
Roblox.Unmute.Error.CannotMuteSelf |
An error response from the RBXUnmuteCommand Class.TextChatCommand. |
Roblox.Unmute.Info.Success |
An success response from the RBXUnmuteCommand Class.TextChatCommand. |