This module uses OOP to facilitate the use of Webhooks to send messages to discord trough Roblox.
Require the module using it's path in the explorer, then create a new webhook object as shown
local WebhookService = require("Module's path").WebhookService
local webhook1 = WebhookService.new("Webhook's name","Webhook's url")
To post use the :Post method in the webhook objet as shown
webhook1:Post("Hello World!") -- Posts "Hello World", no formating.
To create an embed, first require Embeds from the main file, then create a class as shown
local Embeds = require("Module's path").Embeds
local NewEmbed = Embeds.new(
"This is the title",
"This is a description",
Embeds.Colors.Navy -- Choose from any color in the module, or provide a hex value to any color.
"This is the content"
)
To add fields, use the AddField method in the Embed class, arguemnts are: (String) Field's name, (String) Field's value, (boolean) InLine
NewEmbed:AddField("Field 1","Value 1",true) -- Add fields to the embed
NewEmbed:AddField("Field 2", "Value 2", true) -- The first
webhook1:Post(NewEmbed)
The module includes an built-in error handler, but you can change that function to handle it the way you wish.