(Client / Local Script)
Error: “Unrecognized request option url”
game.Players.PlayerAdded:Connect(function(player) --Whenever a player joins
player.Chatted:Connect(function(message) --When a player messages
local HttpService = game:GetService("HttpService")
local Success, Err = pcall(function()
Request = HttpService:RequestAsync(
{
url = "https://api.openai.com/v1/completions/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",
method = "GET",
Headers = {
["type"] = "application/json",
["message"] = message,
["id"] = "",
["name"] = "Chatbot"
},
}
)
end)
if not(Success)then --if error
warn(Err)
else --if sucess
print(Request.Body)
end
end)
end)