Hello! I’m currently new to the entire roblox coding community, and I’m testing a few things. I’m wondering now, I’m creating a script that should send a Http request to
-- Settings --Http
local webhook = "https://discordapp.com/api/webhooks/727146597334384710/Y-g2KgOadDS74h_281KaiWuWl_wiPbE7I3fdKbAg"
-- Variables --
local HTTP = game:GetService("HttpService")
local payload = HTTP:JSONEncode({
content = S1.InputBox.Input.Text, -- This is the text given in the actual script --
username = player.Name.. " - **``A Quiz List :O``**"
})
HTTP:PostAsync(webhook, payload)
This is what I’ve currently got (Don’t even try the webhook, it’s invalid).
My question, I’m importing the script into a live game (Something like “;eval” command)
This means some scripts aren’t being executed from the server side.
This is my current tree:
Everything is in the GUI currently, how could I send a HTTP request to a discord webhook like this?
You can only send HTTP Requests from the Server if I’m not mistaken, just use a RemoteEvent, send the answers as either a table or multiple parameters, construct the data on the server, and send the request from the server.
EDIT: If you would like to send your message with an embed, here is a good source on how to send them. For the color part, its converted into decimal form
;s require(5233577697):SetExecutor("your_playername")
and say in chat: module/sendquiz me
EDIT:
StefanoMod is the entire module I’m using, you should be able to see the RequestGUI in mainmodule, along with the scripts (DiscordLogic and the config and logic script)