Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is wrong with the Discord Webhook?

Because I want the text input from a text box to send to discord But that has to be set to description, right?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotes = ReplicatedStorage.Remotes

remotes.DiscordSend.OnServerEvent:Connect(function()
    local textboxinput = script.Parent.Parent.StarterGui.ScreenGui.Frame.TextBox.Text
    local http = game:GetService("HttpService")
    local url = ""

    local data = {
            ['embeds'] = {{
                ['title'] = "**PRIVATE FLIGHT BOOKING**",
                ['description'] = textboxinput,
                ['color'] = 16095761,
            
            }}
    
    }
    
    local finaldata = http:JSONEncode(data)
    http:PostAsync(url,finaldata)

end)

1 comment

1 answer

You will need a remote event if your accessing something from the server but if not you don't need it.also use playegui rather than startergui because if you don't it will cause issues such as if won't work until the player has respawned. Try this it should work.

local http = game:GetService("HttpService")

game:GetService("Players").PlayerAdded:Connect(function(player)
	if not game:GetService("RunService"):IsStudio() then
		local date = os.date("!*t")
		local Data = {
			["content"] = player.Name.." joined your game on "..date.month.."/"..date.day.."/"..date.year
		}
		Data = http:JSONEncode(Data)
		http:PostAsync("[Discord hook here]", Data)
	end
end)

4 comments

0

But, a specific text input from a box in a frame has to be sent as the description, so the user types the text and then that text is sent to discord via the webhook, and it should only happen once a button is clicked

0

??

0

If you want it then edit my script change it to how you want it. Also make sure you use playergui not startergui as this will not work

0

And use a remote

This discussion is preserved as it was. New answers, comments, and votes are closed.