I have a global chat implemented for my party system, and I now need to filter the chat messages being sent through it.
However, when calling TextService:FilterStringAsync()
, it seemingly yields forever and doesn’t ever return anything.
Here’s the relevant code behind it:
print("Delivering message to "..Player.Name)
--TODO: VERY IMPORTANT!! FIX CHAT FILTER!!
-- Filter message first
print(`Filtering string... chat string: {UnpackedData.Message}, user id: {UnpackedData.UserId}`)
local TextObject = TextService:FilterStringAsync(UnpackedData.Message, tonumber(UnpackedData.UserId))
print("Filtered, getting chat string...")
local FilterResult = TextObject:GetChatForUserAsync(v.UserId)
print("Filtered message: "..FilterResult)
And here’s the output:
Note it’s in a live game. Both parameters are correct.