DInteg/Example/ConfigExample

= Config Example =

-- This Addon was created by: -- Neural Studios -- https://discord.gg/MABm3uVxeZ

dinteg = dinteg or {} dinteg.config = dinteg.config or {} local config = dinteg.config

-- !! Do not touch above this line

config.relay = "https://neuralstudio.co.uk/php/discordrelay-v2.php" -- This is the relay server, do not touch this unless you know what you are doing and host your own relay server

config.defaultWebhook = "" -- default webhook to send messages to if none is specified

timer.Simple(0, function -- do not touch this line local addHook = dinteg.addHook -- do not touch this line local createEmbed = dinteg.createEmbed -- do not touch this line

-- Create your hooks below this line --[[ Functions:     addHook({        hook = "hookname", -- Hook Name  - REQUIRED        name = "unquie name", -- Unquie Name  - REQUIRED        webhook = "webhook url", -- Webhook URL - uses config.defaultWebhook if not specified        message = "message", -- Message to send to the webhook also can be createEmbed  - REQUIRED

color = Color(255, 255, 255), -- Can be Color, {r = 255, g = 255, b = 255} or hex string "#FFFFFF" user = 1 -- argPos of the user to use for the user field in the webhook. Will replace the user field in the webhook with the user that triggered the hook timeout = 5 -- Time in seconds to wait before accepting another message from hook selfDestruct = false -- If true will remove the hook after it has been triggered once })

createEmbed({       title = "title", -- Title of the embed -- Gets Formatted         description = "description", -- Description of the embed -- Gets Formatted         color = Color(255, 255, 255), -- Can be Color, {r = 255, g = 255, b = 255} or hex string "#FFFFFF"        url = "url", -- A url        timestamp = os.time, -- Timestamp of the embed. UNIX time        footer = "footer", -- Footer text -- Gets Formatted         author = "author", -- Name of the author -- Gets Formatted         authorimg = "", -- Url of the author image

}) ]]--

-- Example Hooks

-- Send a message to the default webhook when a player joins addHook({   hook = "PlayerInitialSpawn",    name = "Welcome Message",    webhook = "",    message = createEmbed({ title = "{1} has joined the server", }), })

-- Chat Relay addHook({   hook = "PlayerSay", -- Hook Name    name = "Chat Relay", -- Unquie Name    webhook = "",    message = "{2}", -- {argPos} will be replaced with the argument at that position from the hook    user = 1 -- argPos of the user to use for the user field in the webhook })

-- Announce when the server is shutting down addHook({   hook = "ShutDown",    name = "Shutdown Message",    webhook = "",    message = createEmbed({ title = "The server is restarting/shutting", color = Color(255, 255, 0) }),   selfDestruct = true  -- If true will remove the hook after it has been triggered once })

end) -- do not touch this line