Discord Bad Request (400)

Hi. I’m making commands and when i put in shutdown it says bad request. heres the script:

-- @documentation https://github.com/evaera/Cmdr/blob/master/README.md
-- @source https://github.com/evaera/Cmdr
-- @rostrap Cmdr
-- @author 
local webhookURL = "(removed for privacy)"
local httpService = game:GetService("HttpService")

return function (context, text)
	coroutine.wrap(function()
		local data = {
			["title"] = "GAME SHUTDOWN!",
			["description"] = ("webhook Admin Log - Shutdown. **"..context.Executor.Name.."** has shut down a server."),
			["color"] = 0
			
				}
		local finalData = httpService:JSONEncode(data)
		httpService:PostAsync(webhookURL, finalData)
		
		
			game.Players.ChildAdded:connect(function(h)
				h:Kick()
			end)
			for _,i in pairs (game.Players:GetChildren()) do
				i:Kick()
			end
	end)()

	return "Shutting down.."
end
1 Like

It could be that you forgot to put another " to signal the end of the string.

my bad. I deleted it while making the code box. I edited it.

		local data = {
			["embeds"] = {
				{
					["title"] = "GAME SHUTDOWN!",
					["description"] = ("webhook Admin Log - Shutdown. **"..context.Executor.Name.."** has shut down a server."),
					["color"] = 0
				}
			}
		}
3 Likes

Thanks. Worked. image