Issue with chat tagging every message

Hello,

I am having an issue where in this game [🏛️ [UPDATE 2!] White House Roleplay - Roblox] every message is pretty much getting tagged so instructors are getting annoyed. We do have a custom chat, but I am unsure why it’s being heavily filtered as I am pretty sure I am using the correct chat filter. I’m getting constant reports about the chat filter and how every message is getting tagged and I am unsure why.

This is the Filter String function:

function Shared.FilterString(str, userId)
	local filtered : TextFilterResult
	local succ, err = pcall(function()
		filtered = srv.textService:FilterStringAsync(str, userId, Enum.TextFilterContext.PublicChat)
	end)
	if not succ then
		return string.rep("#", #str)
	end
	return filtered:GetNonChatStringForUserAsync(userId)
end

This is how the chat is being determined in the ChatService module:

	local filtered
	pcall(function()
		filtered = Shared.FilterString(msg, userId)
	end)
	if not filtered then
		return
	end
	
	return filtered

If anyone has a clue why it’s doing this, I’d heavily and greatly appreciate it!

2 Likes

You need to use TextFilterResult:GetChatForUserAsync for both the sender and for the single specific receiver of the message (so call this for every player in the game, passing the target user ID as the first param for GetChatForUserAsync)

1 Like

SendAsync will only work on the client, and I don’t believe you can filter message from the client so I think there is a conflict there.

I could be wrong but doesn’t :SendAsync automatically filter the chat messages for you?

1 Like

I just googled it and yes it does automatically filter the message, I didn’t know that. I deleted the previous message because I knew I did something wrong and you were right

1 Like

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