So I have a ban system on my game which creates a discord webhook log in the server every single time a player is banned. This has worked flawlessly for 4 months however yesterday with NO GAME UPDATE or edits made the webhooks suddenly stopped being able to send.
This is what happens instead:
However, other webhook systems completely unrelated from the ban system have all stopped working too, no webhooks are sending from my game, instead just returning “Bad Request”
Here is some things I thought it could’ve been but isn’t:
HTTP Requests turned on
I have turned this off then back on again multiple times, this does not fix it, my HTTP requests are always on.
Too many webhooks and HTTP requests being sent
I know it’s not this, because if it was too many HTTP requests it would say this instead:
The webhook is broken
I have deleted and recreated the webhook multiple times, copying the URL and making sure it isn’t broken and replacing it, this has not worked either.
Every single webhook script has stopped working?
The funny thing is, I tried the exact same script ON ANOTHER PLACE OF MINE just to check roblox still supported webhooks etc and it worked absolutely fine, seems to only be an issue with my game.
Any ideas or suggestions to fix this would be appreciated, thanks!
Here is the code of ONE SYSTEM which uses webhooks:
local HdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
local http = game:GetService('HttpService')
local OldTableNum = #HdMain.logs.command
while wait(1) do
if OldTableNum ~= #HdMain.logs.command then
local cmd = HdMain.logs.command[#HdMain.logs.command]
local plr = game.Players:FindFirstChild(cmd["speakerName"])
local data = {
["embeds"] = {
{
["author"] = {
["name"] = plr.Name,
["icon_url"] = game.Players:GetUserThumbnailAsync(plr.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
},
["description"] = "Command Logged",
["color"] = 7528527,
["fields"] = {
{
["name"] = "Command",
["value"] = cmd["message"]
}
}
}
}
}
local Data = http:JSONEncode(data)
http:PostAsync("https://discordapp.com/api/webhooks/737330194452447304/7X3iEj3aVThDrksirnKqDn3CqDapdBXXCDfILLL11mTwha5ZWQfKCIcQbuW3LDrjTSUu", Data)
OldTableNum = #HdMain.logs.command
end
end
Please remember that around 5 other systems also use it and are different from this one and that THE EXACT SAME SCRIPTS work in another game so it probably is not the code.
Too many requests means either the Roblox or the Discord servers are unable to handle that many http requests made. Doing that may get your Discord account banned for sending requests that fast, so watch out with webhooks, especially if you use them for high traffic activities, like chatlogs, player joined, left or error debugging. Don’t use while wait(1) that’s way too fast.
That could mean many things. One could be discord banned the request due to high amounts of calls previously or it could be an incorrect data table your sending.
Again, I doubt it is an incorrect table issue since this broke without any edits whatsoever and all 5 webhook scripts which use completely different code all failed, and the EXACT SAME SCRIPT worked in when placed in another game.
I saw a recent post where the Discord webhook couldn’t fetch the player thumbnail, because you wrap an HTTP call in an HTTP call. Could that be the issue?
then it is probably the first option. In that case create a new webhook and try it with that one. If that works you will know it was the previous webhook being disabled due to high volume of requests.