Help with migrating to TextChatService

I am trying to migrate to TextChatService in my experience, but a few issues came up.

For some reason Player.Chatted no longer works on the client. I tried switching my Player.Chatted connections on the client to TextChatService.SendingMessage, but it seems like messages starting with "/e " do not fire the SendingMessage event like they did with Chatted.

Additionally, Chat:RegisterChatCallback doesn’t work at all when using TextChatService.

I’m sure there’s some alternatives for both of these that I don’t know about, but I can’t find anything. If anyone knows the solutions to these, please let me know because I’d love to migrate to TextChatService but I can’t do so at the moment.

4 Likes

I ran into this same issue a little bit ago, did you try using OnIncomingMessage or MessageReceieved? These work for me.

Here’s a quick example I wrote up.

local tcs = game:GetService("TextChatService")

tcs.OnIncomingMessage = function(message)
	print(message.Text) -- Prints twice for some reason, don't know why
end

tcs.MessageReceived:Connect(function(message)
	print(message.Text) -- Prints once!
end)
1 Like

Both OnIncomingMessage and MsesageReceived return “Switch to your R15 avatar to play Emote.” as the TextChatMessage.Text when the message starts with “/e”, so these don’t fit my needs. I also still need an alternative for Chat:RegisterChatCallback specifically so I can filter certain messages to not deliver.

1 Like

I don’t get why Roblox makes new systems just to have more intentional flaws

1 Like

Alright, I was able to find a workaround for both of my issues.

Messages starting with “/e” still fire through Player.Chatted on the server, so I just set up a Player.Chatted connection on the server that sends the actual content of the message to the sender through a remote, and replaced my Player.Chatted connections on the client to OnClientEvent.

It’s very stupid that I have to use a workaround like this for the new chat system being forced on us by Roblox, but whatever.

For Chat:RegisterChatCallback, I found out about TextChannel.ShouldDeliverCallback which works as an almost perfect replacement, the only problem is that the bubble chat still displays to the sender even if the callback returns false. No idea why. I’m not sure if there’s a solution for that but I’ll keep looking.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.