Would have worked with the legacy chat, but the new TextChatService comes with different methods.
The flowchart in this article is very neat for understanding the flow: In-Experience Text Chat System | Documentation - Roblox Creator Hub and appropriate events.
local TextChatService = game:GetService("TextChatService")
TextChatService.SendingMessage:Connect(function(textChatMessage)
print("Channel: "..textChatMessage.TextChannel.Name)
print("Text: "..textChatMessage.Text)
end)