I made a gui that asks the user for a Discord webhook to during the setup. This then gets stored in a datastore. I was testing it and when I tried to post a message using the PostAsync function of HttpService, it threw that error, have any ideas on how to fix this?
This is the code for the script
local HttpsService = game:GetService("HttpService")
local dbs = game:GetService("DataStoreService")
local isWhitelisted = dbs:GetDataStore("")
local webhook = isWhitelisted:GetAsync("")
local Remote = script.Parent.Parent.Parent.Remotes.Test
Remote.OnServerEvent:Connect(function(user, username)
local data = {
content = "This is a test!"
username = user.Name;
avatar_url = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userId=" .. user.UserId
}
HttpsService:PostAsync(webhook, HttpsService:JSONEncode(data))
end)
I deleted the datastore names since I don’t think you need those, if you do, I’ll be happy to edit them in.
You can’t use roblox.com as HttpService doesn’t allow you to use ROBLOX domain.
Instead use a proxy, kind of like a mid server if you will. You can use this rprxy.xyz, you can also use your own website to work as a proxy but it’s more complicated and there will obviously be more steps towards it.