local X=game:GetService("\067\104\097\116")local N=X:WaitForChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")local K=N:WaitForChild("\067\111\109\109\097\110\100\077\111\100\117\108\101\115")local V=require(K:WaitForChild("\085\116\105\108"))local f=script.Parent local q=require(N:WaitForChild("\067\104\097\116\083\101\116\116\105\110\103\115"))function methods.SetupCommandProcessors(X)local N=K:GetChildren()for K=1,#N,1 do if N[K]:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")then if N[K].Name~="\085\116\105\108"then local f=require(N[K])local q=f[V.KEY_COMMAND_PROCESSOR_TYPE]local s=f[V.KEY_PROCESSOR_FUNCTION]if q==V.IN_PROGRESS_MESSAGE_PROCESSOR then table.insert(X.InProgressMessageProcessors,s)elseif q==V.COMPLETED_MESSAGE_PROCESSOR then table.insert(X.CompletedMessageProcessors,s)end end end end end function methods.ProcessCompletedChatMessage(K,X,N)for V=1,#K.CompletedMessageProcessors,1 do local f=K.CompletedMessageProcessors[V](X,N,q)if f then return true end end return false end function methods.ProcessInProgressChatMessage(V,X,N,K)for f=1,#V.InProgressMessageProcessors,1 do local s=V.InProgressMessageProcessors[f](X,N,K,q)if s then return s end end return nil end
--////////////////////////////// Include
--//////////////////////////////////////
local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local commandModules = clientChatModules:WaitForChild("CommandModules")
local commandUtil = require(commandModules:WaitForChild("Util"))
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))

function methods:SetupCommandProcessors()
	local commands = commandModules:GetChildren()
	for i = 1, #commands do
		if commands[i]:IsA("ModuleScript") then
			if commands[i].Name ~= "Util" then
				local commandProcessor = require(commands[i])
				local processorType = commandProcessor[commandUtil.KEY_COMMAND_PROCESSOR_TYPE]
				local processorFunction = commandProcessor[commandUtil.KEY_PROCESSOR_FUNCTION]
				if processorType == commandUtil.IN_PROGRESS_MESSAGE_PROCESSOR then
					table.insert(self.InProgressMessageProcessors, processorFunction)
				elseif processorType == commandUtil.COMPLETED_MESSAGE_PROCESSOR then
					table.insert(self.CompletedMessageProcessors, processorFunction)
				end
			end
		end
	end
end

function methods:ProcessCompletedChatMessage(message, ChatWindow)
	for i = 1, #self.CompletedMessageProcessors do
		local processedCommand = self.CompletedMessageProcessors[i](message, ChatWindow, ChatSettings)
		if processedCommand then
			return true
		end
	end
	return false
end

function methods:ProcessInProgressChatMessage(message, ChatWindow, ChatBar)
	for i = 1, #self.InProgressMessageProcessors do
		local customState = self.InProgressMessageProcessors[i](message, ChatWindow, ChatBar, ChatSettings)
		if customState then
			return customState
		end
	end
	return nil
end
