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