From b91d1e3d98df761c7a7993859c3bfe2280308208 Mon Sep 17 00:00:00 2001 From: Sovereignty Date: Sat, 26 Apr 2025 16:13:32 +0000 Subject: [PATCH] Add Example server script file for demonstration --- src/ServerScripts/Example.server.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/ServerScripts/Example.server.lua diff --git a/src/ServerScripts/Example.server.lua b/src/ServerScripts/Example.server.lua new file mode 100644 index 0000000..3789dbb --- /dev/null +++ b/src/ServerScripts/Example.server.lua @@ -0,0 +1,28 @@ +local errorPopper = require(game:GetService("ServerStorage").ErrorPopper) + +--Both SetURL and CustomFields must be called prior to starting the ErrorPopper module. +errorPopper.SetURL("https://discord.com/api/webhooks/...") + +--CustomFields returns a table containing a single chainable method called add. +--The order of .add method chaining dictates the embeded message display order for each field. +errorPopper.CustomFields() + .add({ + ["name"] = "Example", + + ["value"] = function() + return "Value" + end, + + ["inline"] = false + }) + +--Start listening for errors and sending webhook messages. +errorPopper.Start() + +-- +--[[ Or, in the event you have no custom fields. ]] +-- + +errorPopper + .SetURL("https://discord.com/api/webhooks/...") + .Start() \ No newline at end of file