function module.new(L,C)local t=setmetatable({},methods)t.ChatService=L t.PlayerObj=nil t.Name=C t.ExtraData={}t.Channels={}t.MutedSpeakers={}t.eDestroyed=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eSaidMessage=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eReceivedMessage=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eReceivedUnfilteredMessage=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eMessageDoneFiltering=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eReceivedSystemMessage=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eChannelJoined=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eChannelLeft=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eMuted=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eUnmuted=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eExtraDataUpdated=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eMainChannelSet=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.eChannelNameColorUpdated=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")t.Destroyed=t.eDestroyed.Event t.SaidMessage=t.eSaidMessage.Event t.ReceivedMessage=t.eReceivedMessage.Event t.ReceivedUnfilteredMessage=t.eReceivedUnfilteredMessage.Event t.MessageDoneFiltering=t.eMessageDoneFiltering.Event t.ReceivedSystemMessage=t.eReceivedSystemMessage.Event t.ChannelJoined=t.eChannelJoined.Event t.ChannelLeft=t.eChannelLeft.Event t.Muted=t.eMuted.Event t.Unmuted=t.eUnmuted.Event t.ExtraDataUpdated=t.eExtraDataUpdated.Event t.MainChannelSet=t.eMainChannelSet.Event t.ChannelNameColorUpdated=t.eChannelNameColorUpdated.Event t.RecievedUnfilteredMessage=t.eReceivedUnfilteredMessage.Event return t end return module


function module.new(vChatService, name)
	local obj = setmetatable({}, methods)

	obj.ChatService = vChatService

	obj.PlayerObj = nil

	obj.Name = name
	obj.ExtraData = {}

	obj.Channels = {}
	obj.MutedSpeakers = {}

	-- Make sure to destroy added binadable events in the InternalDestroy method.
	obj.eDestroyed = Instance.new("BindableEvent")
	obj.eSaidMessage = Instance.new("BindableEvent")
	obj.eReceivedMessage = Instance.new("BindableEvent")
	obj.eReceivedUnfilteredMessage = Instance.new("BindableEvent")
	obj.eMessageDoneFiltering = Instance.new("BindableEvent")
	obj.eReceivedSystemMessage = Instance.new("BindableEvent")
	obj.eChannelJoined = Instance.new("BindableEvent")
	obj.eChannelLeft = Instance.new("BindableEvent")
	obj.eMuted = Instance.new("BindableEvent")
	obj.eUnmuted = Instance.new("BindableEvent")
	obj.eExtraDataUpdated = Instance.new("BindableEvent")
	obj.eMainChannelSet = Instance.new("BindableEvent")
	obj.eChannelNameColorUpdated = Instance.new("BindableEvent")

	obj.Destroyed = obj.eDestroyed.Event
	obj.SaidMessage = obj.eSaidMessage.Event
	obj.ReceivedMessage = obj.eReceivedMessage.Event
	obj.ReceivedUnfilteredMessage = obj.eReceivedUnfilteredMessage.Event
	obj.MessageDoneFiltering = obj.eMessageDoneFiltering.Event
	obj.ReceivedSystemMessage = obj.eReceivedSystemMessage.Event
	obj.ChannelJoined = obj.eChannelJoined.Event
	obj.ChannelLeft = obj.eChannelLeft.Event
	obj.Muted = obj.eMuted.Event
	obj.Unmuted = obj.eUnmuted.Event
	obj.ExtraDataUpdated = obj.eExtraDataUpdated.Event
	obj.MainChannelSet = obj.eMainChannelSet.Event
	obj.ChannelNameColorUpdated = obj.eChannelNameColorUpdated.Event

	--- DEPRECATED:
	--- Mispelled version of ReceivedUnfilteredMessage, retained for compatibility with legacy versions.
	obj.RecievedUnfilteredMessage = obj.eReceivedUnfilteredMessage.Event

	return obj
end

return module
