Hello.
Basically, I’m trying to send a message to my discord server’s moderator logs everytime I want to. This works perfect in studio, but when I try it out in game it throws a “Http 403 (Forbidden)”
error.
Module script: (throws error at line 21 where it posts)
local Discord = {}
local url = "you aren't seeing this"
local HttpService = game:GetService("HttpService")
local isStudio = game:GetService("RunService"):IsStudio()
function Discord:Send(message)
local dt = DateTime.now()
local studio = "Not In Studio"
if isStudio then studio = "In Studio" end
local otherMessage = "("..dt:FormatLocalTime("LLLL", "en-us")..", "..studio..")"
local messageData = {
["content"] = tostring(message).."\n"..otherMessage
}
local success, err = pcall(function()
HttpService:PostAsync(url, HttpService:JSONEncode(messageData)) -- post the message
end)
if not success then
warn(err)
end
end
return Discord
The second script is me using the function Discord:Send(player.Name.." has joined the game!")
. This part works perfectly in studio but creates an error in game.
Image of the error.
And yes, HttpRequests are enabled in the settings.