function methods.InternalDestroy(q)for n,g in pairs(q.Channels)do g:InternalRemoveSpeaker(q)end q.eDestroyed:Fire()q.eDestroyed:Destroy()q.eSaidMessage:Destroy()q.eReceivedMessage:Destroy()q.eMessageDoneFiltering:Destroy()q.eReceivedSystemMessage:Destroy()q.eChannelJoined:Destroy()q.eChannelLeft:Destroy()q.eMuted:Destroy()q.eUnmuted:Destroy()q.eExtraDataUpdated:Destroy()q.eMainChannelSet:Destroy()q.eChannelNameColorUpdated:Destroy()end function methods.InternalAssignPlayerObject(n,q)n.PlayerObj=q end function methods.InternalSendMessage(g,q,n)local M,N=pcall(function()g.eReceivedMessage:Fire(q,n)end)if not M and N then print("\069\114\114\111\114 \115\101\110\100\105\110\103 \105\110\116\101\114\110\097\108 \109\101\115\115\097\103\101\058 "..N)end end function methods.InternalSendFilteredMessage(g,q,n)local M,N=pcall(function()g.eMessageDoneFiltering:Fire(q,n)end)if not M and N then print("\069\114\114\111\114 \115\101\110\100\105\110\103 \105\110\116\101\114\110\097\108 \102\105\108\116\101\114\101\100 \109\101\115\115\097\103\101\058 "..N)end end function methods.InternalSendSystemMessage(g,q,n)local M,N=pcall(function()g.eReceivedSystemMessage:Fire(q,n)end)if not M and N then print("\069\114\114\111\114 \115\101\110\100\105\110\103 \105\110\116\101\114\110\097\108 \115\121\115\116\101\109 \109\101\115\115\097\103\101\058 "..N)end end function methods.UpdateChannelNameColor(g,q,n)g.eChannelNameColorUpdated:Fire(q,n)end

function methods:InternalDestroy()
	for i, channel in pairs(self.Channels) do
		channel:InternalRemoveSpeaker(self)
	end

	self.eDestroyed:Fire()

	self.eDestroyed:Destroy()
	self.eSaidMessage:Destroy()
	self.eReceivedMessage:Destroy()
	self.eMessageDoneFiltering:Destroy()
	self.eReceivedSystemMessage:Destroy()
	self.eChannelJoined:Destroy()
	self.eChannelLeft:Destroy()
	self.eMuted:Destroy()
	self.eUnmuted:Destroy()
	self.eExtraDataUpdated:Destroy()
	self.eMainChannelSet:Destroy()
	self.eChannelNameColorUpdated:Destroy()
end

function methods:InternalAssignPlayerObject(playerObj)
	self.PlayerObj = playerObj
end

function methods:InternalSendMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eReceivedMessage:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal message: " ..err)
	end
end

function methods:InternalSendFilteredMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eMessageDoneFiltering:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal filtered message: " ..err)
	end
end

function methods:InternalSendSystemMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eReceivedSystemMessage:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal system message: " ..err)
	end
end

function methods:UpdateChannelNameColor(channelName, channelNameColor)
	self.eChannelNameColorUpdated:Fire(channelName, channelNameColor)
end
