Changing / filtering messages with new TextChatService?

Hello,
I’m beginning to use the new TextChatService but was wondering if I was able to change players’ messages like I was able to with the legacy chat?

For example, if the player typed “Hello World!” it would instead change it and display the message as “ChangedMessage”, both on the chat window and the bubble chat.

Any help would be greatly appreciated! :slight_smile:

Sure, you should be able to do something like this with OnIncomingMessage:

TextChatService.OnIncomingMessage = function(textChatMessage)
    if textChatMessage.Text == "Hello World!" then
        local properties = Instance.new("TextChatMessageProperties")
        properties.Text = "ChangedMessage"
        return properties
    end
end
2 Likes