Discord Webhook Excecuter

Hi! I noticed that many people are paying too much money for a simple thing which is Discord Webhooks
So I decided to make a module to help people out!
This module is basically used to send discord webhooks through roblox, it is simple to use and helpful.
How can I use it?

  1. Create your Webhook
    To create your webhook, go to the channel you want the webhook to be sent into!
    And then click on channel settings button!
    image

Then choose integrations
image

Click on “Webhooks” and then “Create New Webhook”
Set your webhook up,
image

Click on “Copy Webhook url”, you will need the url later.

  1. Now Let’s set the module up
    MAKE SURE HTTPS REQUESTS ARE ENABLED IN STUDIO SETTINGS
    Go to studio, and create a module script in ServerScriptService and name it “Discord”
    And paste the following inside it
local Https = game:GetService("HttpService")
local module = {}
module.Send = function(Webhook, Data)
	print(Data)
	local NewData
	local success, errormessage = pcall(function()
		NewData = Https:JSONEncode(Data)
	end)
	if success then
		print("Successfully Encoded Data")
	else
		error("Failed to encode data, Are you sure it is a table?")
	end

	local success1, errormessage1 = pcall(function()
		print(NewData)
		Https:PostAsync(Webhook, NewData)
	end)
	
	if success1 then
		print("Successfully Sent Data")
	else
		error("Error: Failed to Send Data, Double Check your webhook url and your data.")
	end
end

return module

Now we are done with the setup!

Now to use it through a script, you have to require the module by doing

local Discord = require(game.ServerScriptService.Discord)

To send something through it, you must make a table with the information you want to send like so.
Make sure to read this discord document about webhook structure first

local Data = {
	content = "Hi",
	embeds = {
		{
			title = "Discord Webhook",
			description = "This is a discord webhook, it is excecuted through roblox!",
			color = 255
		}
	}
}

Then you would want to send it by doing so.

Discord.Send("WEBHOOK URL", Data)

At the end the script would be like this

local Discord = require(game.ServerScriptService.Discord)
local Data = {
	content = "Hi",
	embeds = {
		{
			title = "Discord Webhook",
			description = "This is a discord wbehook, it is excecuted through roblox!",
			color = 255
		}
	}
}
Discord.Send("https://discord.com/api/webhooks/784193771356160021/oTZ2ZU_I4B9reQzg3UxU7HEIhDlDJZwXjUBBP-B4S9l-gcRr27q8wyEt0G9LjTOrAKCv", Data)

and the message would look like this
image

Example Usage:

local Discord = require(game.ServerScriptService.Discord)
game.Players.PlayerAdded:Connect(function(Player)
local Data = {
	embeds = {
		{
			title = "A Player has joined!",
			color = 255,
			fields = {
					{
						name = "Player Name",
						value = Player.Name
					},
					{
						name = "Player Id",
						value = Player.UserId
					}
			}
		}
	}
}
	Discord.Send("https://discord.com/api/webhooks/784193771356160021/oTZ2ZU_I4B9reQzg3UxU7HEIhDlDJZwXjUBBP-B4S9l-gcRr27q8wyEt0G9LjTOrAKCv", Data)
end)

That will send a message when a player joins the game!

You have reached the end, enjoy the module
I know it is simple but many people need it

If you have any questions, reply to this topic and I will be happy to answer!

7 Likes

Hello, can you explain this part? how does people pay money to use discord webhooks?

I’ve seen multiple people paying over 1k robux just to get somebody to script a webhook for them

2 Likes

Great “tutorial”! This was really helpful for people like me, so we can use Discord Webhooks easier without paying another to help!

1 Like

Oof, they are getting scammed pretty hard

1 Like

Don’t waste your time, just use discohook.org, honestly better than executing a script off roblox studio.

1 Like

Will you use this website to execute a webhook when something happen in-game?

How is this different from the other 9372839482 discord modules people have made over and over and over.