ChatMessage.Message property?

How can I access ChatMessage.Message?
http://wiki.roblox.com/index.php?title=Lua_Chat_System/Server_API/ChatMessage#Message

Having this code in a ChatModule always outputs false for IsFiltered and Message property doesn’t exist.

local function Run(ChatService)
	ChatService:GetChannel("All").MessagePosted:Connect(function(message)
		for i,v in next, message do
			print(i,v)
		end
	end)
end
 
return Run

Edit:
It seems like the wiki contradicts the code in the ChatChannel module too. The wiki says that Message will be nil if filtered is true but this code inside of methods:InternalCreateMessageObject shows that its the opposite:

local messageObj =
	{
		ID = self.ChatService:InternalGetUniqueMessageId(),
		FromSpeaker = fromSpeaker,
		SpeakerUserId = speakerUserId,
		OriginalChannel = self.Name,
		MessageLength = string.len(message),
		MessageType = messageType,
		IsFiltered = isFiltered,
		Message = isFiltered and message or nil,
		--// These two get set by the new API. The comments are just here
		--// to remind readers that they will exist so it's not super
		--// confusing if they find them in the code but cannot find them
		--// here.
		--FilterResult = nil,
		--IsFilterResult = false,
		Time = os.time(),
		ExtraData = {},
	}

Also only system/server messages are marked as true for being filtered I think while user messages are marked as false.

So if I change the line to:
Message = (not isFiltered and message) or nil,

Then it works, but am I doing something wrong?

Edit 2:
It breaks whispering (at least with a non player).

1 Like