function module.new(I,J,z,G)local R=setmetatable({},methods)R.ChatService=I R.Name=J R.WelcomeMessage=z or""R.GetWelcomeMessageFunction=nil R.ChannelNameColor=G R.Joinable=true R.Leavable=true R.AutoJoin=false R.Private=false R.Speakers={}R.Mutes={}R.MaxHistory=200 R.HistoryIndex=0 R.ChatHistory={}R.FilterMessageFunctions=Util:NewSortedFunctionContainer()R.ProcessCommandsFunctions=Util:NewSortedFunctionContainer()R.eDestroyed=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")R.eMessagePosted=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")R.eSpeakerJoined=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")R.eSpeakerLeft=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")R.eSpeakerMuted=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")R.eSpeakerUnmuted=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")R.MessagePosted=R.eMessagePosted.Event R.SpeakerJoined=R.eSpeakerJoined.Event R.SpeakerLeft=R.eSpeakerLeft.Event R.SpeakerMuted=R.eSpeakerMuted.Event R.SpeakerUnmuted=R.eSpeakerUnmuted.Event R.Destroyed=R.eDestroyed.Event return R end return module


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

	obj.ChatService = vChatService

	obj.Name = name
	obj.WelcomeMessage = welcomeMessage or ""
	obj.GetWelcomeMessageFunction = nil
	obj.ChannelNameColor = channelNameColor

	obj.Joinable = true
	obj.Leavable = true
	obj.AutoJoin = false
	obj.Private = false

	obj.Speakers = {}
	obj.Mutes = {}

	obj.MaxHistory = 200
	obj.HistoryIndex = 0
	obj.ChatHistory = {}

	obj.FilterMessageFunctions = Util:NewSortedFunctionContainer()
	obj.ProcessCommandsFunctions = Util:NewSortedFunctionContainer()

	-- Make sure to destroy added binadable events in the InternalDestroy method.
	obj.eDestroyed = Instance.new("BindableEvent")
	obj.eMessagePosted = Instance.new("BindableEvent")
	obj.eSpeakerJoined = Instance.new("BindableEvent")
	obj.eSpeakerLeft = Instance.new("BindableEvent")
	obj.eSpeakerMuted = Instance.new("BindableEvent")
	obj.eSpeakerUnmuted = Instance.new("BindableEvent")

	obj.MessagePosted = obj.eMessagePosted.Event
	obj.SpeakerJoined = obj.eSpeakerJoined.Event
	obj.SpeakerLeft = obj.eSpeakerLeft.Event
	obj.SpeakerMuted = obj.eSpeakerMuted.Event
	obj.SpeakerUnmuted = obj.eSpeakerUnmuted.Event
	obj.Destroyed = obj.eDestroyed.Event

	return obj
end

return module
