return function(J)local M=J.Server local o=J.Service local G=M.Settings local A,R,w,d,K,I,h,B,Q,m,D=M.Functions,M.Commands,M.Admin,M.Anti,M.Core,M.HTTP,M.Logs,M.Remote,M.Process,M.Variables,M.Deps o.TrackTask("\084\104\114\101\097\100\058 \087\069\066\080\065\078\069\076\095\074\083\079\078\095\085\080\068\065\084\069",function()wait(1)local J=rawget(_G,"\065\068\079\078\073\083\087\069\066\095\067\077\068\095\074\083\079\078\095\068\079\085\080\068\065\084\069")local M=rawget(_G,"\065\068\079\078\073\083\087\069\066\095\067\077\068\095\074\083\079\078\095\083\069\067\082\069\084")local G=rawget(_G,"\065\068\079\078\073\083\087\069\066\095\067\077\068\095\074\083\079\078\095\069\078\068\080\079\073\078\084")if not J or not M or not G then return end print("\087\069\066 \069\078\065\066\076\069\068 \068\079 \085\080\068\065\084\069")if K.DebugMode and J then print("\068\069\066\085\071 \068\079 \076\065\085\078\067\072 \069\078\065\066\076\069\068")wait(5)local J={}local w=o.HttpService local d=A.Base64Encode local K=A.Base64Decode for M,o in next,R do table.insert(J,{Index=M;Prefix=o.Prefix;Commands=o.Commands;Arguments=o.Args;AdminLevel=o.AdminLevel,Hidden=o.Hidden or false;NoFilter=o.NoFilter or false})end print("\076\065\085\078\067\072\073\078\071")local I,h=pcall(w.RequestAsync,w,{Url=G;Method="\080\079\083\084",Headers={["\067\111\110\116\101\110\116-\084\121\112\101"]="\097\112\112\108\105\099\097\116\105\111\110\047\106\115\111\110";Secret=M},Body=w:JSONEncode({data=d(w:JSONEncode(J))})})print("\076\065\085\078\067\072\069\068 \084\079 \087\069\066\080\065\078\069\076")print("\082\069\083\080\079\078\083\069 \066\069\076\079\087")print("\083\085\067\067\069\083\083\058 "..(tostring(I)..("\n"..("\082\069\083\080\079\078\083\069\058\n"..(h and w.JSONEncode(h)))))or h)end end)end
--// This module is only used to generate and update a list of non-custom commands for the webpanel and will not operate under normal circumstances

return function(Vargs)
	local server = Vargs.Server
	local service = Vargs.Service

	local Settings = server.Settings
	local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
		server.Functions,
		server.Commands,
		server.Admin,
		server.Anti,
		server.Core,
		server.HTTP,
		server.Logs,
		server.Remote,
		server.Process,
		server.Variables,
		server.Deps

	--if true then return end --// fully disabled
	service.TrackTask("Thread: WEBPANEL_JSON_UPDATE", function()
		wait(1)
		local enabled = rawget(_G, "ADONISWEB_CMD_JSON_DOUPDATE")
		local secret = rawget(_G, "ADONISWEB_CMD_JSON_SECRET")
		local endpoint = rawget(_G, "ADONISWEB_CMD_JSON_ENDPOINT")
		if not enabled or not secret or not endpoint then
			return
		end

		print("WEB ENABLED DO UPDATE")

		if Core.DebugMode and enabled then
			print("DEBUG DO LAUNCH ENABLED")
			wait(5)

			local list = {}
			local HTTP = service.HttpService
			local Encode = Functions.Base64Encode
			local Decode = Functions.Base64Decode

			for i, cmd in next, Commands do
				table.insert(list, {
					Index = i,
					Prefix = cmd.Prefix,
					Commands = cmd.Commands,
					Arguments = cmd.Args,
					AdminLevel = cmd.AdminLevel,
					Hidden = cmd.Hidden or false,
					NoFilter = cmd.NoFilter or false,
				})
			end

			--warn("COMMANDS LIST JSON: ");
			--print("\n\n".. HTTP:JSONEncode(list) .."\n\n");
			--print("ENCODED")
			--// LAUNCH IT
			print("LAUNCHING")
			local success, res = pcall(HTTP.RequestAsync, HTTP, {
				Url = endpoint,
				Method = "POST",
				Headers = {
					["Content-Type"] = "application/json",
					["Secret"] = secret,
				},

				Body = HTTP:JSONEncode({
					["data"] = Encode(HTTP:JSONEncode(list)),
				}),
			})

			print("LAUNCHED TO WEBPANEL")
			print("RESPONSE BELOW")
			print("SUCCESS: " .. tostring(success) .. "\n" .. "RESPONSE:\n" .. (res and HTTP.JSONEncode(res)) or res)
		end
	end)
end
