Webhook Help For Ban Appeal System

Hey! I would like to make a ban appeal form in roblox studio (already have it made) and I would like to form to send to a discord channel via. webhooks, can somebody help me?

Server Script Inside Of ServerScriptService

local url = "https://hooks.hyra.io/api/ Not Sharing Webhook"
local http = game:GetService("HttpService")
local player = game.Players.LocalPlayer

player.PlayerGui.BanAppeal.Form.Submit.MouseButton1Click:Connect(function()
	local player = game.Players.LocalPlayer
	if not player then
		return
	end

	local data = {
		['embeds'] = {{
			['title'] = "New Ban Appeal From " .. player.Name .. ":" .. player.UserId,
			['description'] = "Ban Appeal",
			['color'] = 082888,

			['fields'] = {
				{
					['name'] = "Why were you banned?",
					['value'] = script.Parent.Parent.Question1.Answer.Text,
					['inline'] = false
				},
				{
					['name'] = "Why did you do this action that caused you to get banned?",
					['value'] = script.Parent.Parent.Question2.Answer.Text,
					['inline'] = false
				},
				{
					['name'] = "Why do you believe you should be unbanned?",
					['value'] = script.Parent.Parent.Question3.Answer.Text,
					['inline'] = false
				},
				{
					['name'] = "Do you understand that your appeal may be denied?",
					['value'] = "Yes",
					['inline'] = false
				},
				{
					
					['name'] = "Do you agree to not contact us regarding your appeal? You may rejoin to check your appeal status.",
					['value'] = "Yes",
					['inline'] = false
				},
				{
					['name'] = "End Of Ban Appeal",
					['value'] = "Extra Player Information Below",
					['inline'] = false
				},
				{
					['name'] = "Account User ID: ",
					['value'] = player.UserId,
					['inline'] = false
				},
				{
					['name'] = "Account Profile URL: ",
					['value'] = "https://www.roblox.com/users/" .. player.UserId .. "/profile",
					['inline'] = false
				}
			},

			['footer'] = {
				['text'] = "Server ID: Ban Appeal (TCRP Ban Hub) | Public Server"
			}
		}}
	}

	local finaldata = http:JSONEncode(data)
	http:PostAsync(url, finaldata)
end)
1 Like

You cannot use this in a server script. Best of all - to use RemoteEvent and to send the information to the server.

1 Like

Do you think you could help me set that all up?

This is example.

Server:

local url = "https://hooks.hyra.io/api/Not Sharing Webhook"
local http = game:GetService("HttpService")
local cd = {}

game.ReplicatedStorage.BanAppeal.OnServerEvent:Connect(function(player, q1, q2, q3)
	if not q1 or typeof(q1)~="string" or not q2 or typeof(q2)~="string" or not q3 or typeof(q3)~="string" then return end
	if cd[player.UserId] and cd[player.UserId]>tick() then
		return
	else
		cd[player.UserId]=tick()+120 --2 min
	end
	local data = {
		['embeds'] = {{
			['title'] = "New Ban Appeal From " .. player.Name .. ":" .. player.UserId,
			['description'] = "Ban Appeal",
			['color'] = 082888,

			['fields'] = {
				{
					['name'] = "Why were you banned?",
					['value'] = q1,
					['inline'] = false
				},
				{
					['name'] = "Why did you do this action that caused you to get banned?",
					['value'] = q2,
					['inline'] = false
				},
				{
					['name'] = "Why do you believe you should be unbanned?",
					['value'] = q3,
					['inline'] = false
				},
				{
					['name'] = "Do you understand that your appeal may be denied?",
					['value'] = "Yes",
					['inline'] = false
				},
				{

					['name'] = "Do you agree to not contact us regarding your appeal? You may rejoin to check your appeal status.",
					['value'] = "Yes",
					['inline'] = false
				},
				{
					['name'] = "End Of Ban Appeal",
					['value'] = "Extra Player Information Below",
					['inline'] = false
				},
				{
					['name'] = "Account User ID: ",
					['value'] = player.UserId,
					['inline'] = false
				},
				{
					['name'] = "Account Profile URL: ",
					['value'] = "https://www.roblox.com/users/" .. player.UserId .. "/profile",
					['inline'] = false
				}
			},

			['footer'] = {
				['text'] = "Server ID: Ban Appeal (TCRP Ban Hub) | Public Server"
			}
		}}
	}

	local finaldata = http:JSONEncode(data)
	http:PostAsync(url, finaldata)
end)

Client:

button.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.BanAppeal:FireServer(gui.Question1.Answer.Text, gui.Question2.Answer.Text, gui.Question3.Answer.Text)
end)
2 Likes

IT WORKED!!! Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.