Class · inherits Instance
TextChatMessage
A data object representing a text chat message.
About TextChatMessage
A data object representing a text chat message.
To learn more about using TextChatMessages, see In-Experience Text Chat.
Properties 11
BubbleChatMessageProperties
: BubbleChatMessagePropertiesA reference to theBubbleChatMessagePropertiesthat overrides the appearance of this message's chat bubble.A reference to the
BubbleChatMessagePropertiesinstance that overridesBubbleChatConfigurationproperties for this individual message's chat bubble.This property is
nilby default. It is populated when yourTextChatService.OnBubbleAddedcallback returns aBubbleChatMessagePropertiesinstance: the returned instance is stored here on the resultingTextChatMessage. Any properties set on it take precedence over the sharedBubbleChatConfigurationwhen the message's bubble is rendered.ChatWindowMessageProperties
: ChatWindowMessagePropertiesA reference to theChatWindowMessagePropertiesthat overrides the appearance of this message in the chat window.A reference to the
ChatWindowMessagePropertiesinstance that overridesChatWindowConfigurationproperties for this individual message as displayed in the chat window.This property is
nilby default. It is populated when yourTextChatService.OnChatWindowAddedcallback returns aChatWindowMessagePropertiesinstance, typically created withChatWindowConfiguration.DeriveNewMessageProperties: the returned instance is stored here on the resultingTextChatMessage. Any properties set on it take precedence over the sharedChatWindowConfigurationwhen the message is rendered.MessageId
: stringA unique identifier for theTextChatMessage.Metadata
: stringA general purpose field for storing miscellaneous data about theTextChatMessage.A general purpose field for storing miscellaneous data about the
TextChatMessage. The second argument ofTextChannel.SendAsyncandTextChannel.DisplaySystemMessageis used to populate this field.Use this field to apply additional formatting for special messages within
TextChatService.OnIncomingMessageandTextChannel.OnIncomingMessagecallbacks.local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") local customChannel: TextChannel = Instance.new("TextChannel") customChannel.Parent = TextChatService:WaitForChild("TextChannels") customChannel.OnIncomingMessage = function(message: TextChatMessage) if string.find(message.Metadata, "Error") then local overrideProperties = Instance.new("TextChatMessageProperties") overrideProperties.Text = string.format("<font color='rgb(255,0,0)'>%s</font>", message.Text) return overrideProperties elseif string.find(message.Metadata, "Info") then local overrideProperties = Instance.new("TextChatMessageProperties") overrideProperties.Text = string.format("<font color='rgb(0, 255, 150)'>%s</font>", message.Text) return overrideProperties end return nil end Players.LocalPlayer.CharacterAdded:Connect(function() customChannel:DisplaySystemMessage("This is an error!", "Game.Error.Generic") customChannel:DisplaySystemMessage("Could not find save data!", "Game.Error.SaveDataNotFound") customChannel:DisplaySystemMessage("You won the game!", "Game.Info.Win") customChannel:DisplaySystemMessage("You lost the game!", "Game.Info.Lose") end)As follows is a reference of the default system messages emitted by the chat system:
PrefixText
: stringA prefix to add to a user's message.A prefix to add to a user's message. This supports Rich Text, so developers can set custom properties for this text to support chat tags.
By default,
TextChatMessage.PrefixTextis the name of theTextSource, which is thePlayer.DisplayNameof the user associated with theTextSourceviaTextSource.UserId.Status
: TextChatMessageStatusIndicates the status of theTextChatMessage.Text
: stringThe filtered text message for the user.The filtered text message for the user. Different users may receive different strings from this property based on filtering rules. It can be an empty string.
TextChannel
: TextChannelA reference to the originTextChannel.TextSource
: TextSourceA reference to the originTextSource.Timestamp
: DateTimeA timestamp of when the message was originally sent.Translation
: stringTranslated and filtered text message.Represents translated and filtered text messages based on users' localization settings. The system doesn't translate messages between users with the same localization settings or using languages without the text filter support, so this property can be an empty string if no translation happens. For customization, see Customizing Translated Messages.
TextChatMessage also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.