So, I recently switched over to Guilded for chatlogs as Discord now denies the request and everything works fine in studio but in game, I get the error:
HTTP 403 (forbidden)
The code:
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local webhook = "Insert webhook link here"
Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local data = {
content = msg;
username = plr.Name .. " - (#" .. plr.UserId .. ")";
avatar_url = "http://www.roblox.com/Thumbs/Avatar.a...​"..plr.UserId
}
HttpService:PostAsync(webhook, HttpService:JSONEncode(data))
end)
end)
Has Guilded also blocked webhooks for Roblox or am I doing something wrong?
Depending on the size of your game and how many messages are being sent, the webhook may get blocked by either Discord/Guilded or any proxy service you use. There are some solutions though if you really need to log everything said in chat, though:
Have all messages be stored in a table and then send a message “block” to the webhook once enough time has passed or when there’s too many messages in the table. This will prevent you from violating any rate limits depending on the size of your game.
Pay for a premium service that is made for logging things on a larger scale
As for answering the question directly: yes, Discord has blocked webhook requests directly from Roblox. This is is because of many developers not respecting the rate limits and using Discord as a logging service when that is not what they intended webhooks to be used for (I assume). They will work from studio because webhook requests sent from studio go directly from your network to Discord. Webhook requests sent from inside an actual Roblox server are sent from Roblox, and are therefore blocked.