Skip to content

Latest commit

 

History

History
58 lines (34 loc) · 1.4 KB

README.md

File metadata and controls

58 lines (34 loc) · 1.4 KB

Roblox to Discord integration module.

This module uses OOP to facilitate the use of Webhooks to send messages to discord trough Roblox.

How to use it?

Seting up

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")

Posting simple messages

To post use the :Post method in the webhook objet as shown

webhook1:Post("Hello World!") -- Posts "Hello World", no formating.

Creating an embed

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"
)

Adding fields

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)

Error handler

The module includes an built-in error handler, but you can change that function to handle it the way you wish.