generated from Sovereignty/rojo-selene-luau-template
Add Example server script file for demonstration
This commit is contained in:
parent
29d077126f
commit
b91d1e3d98
1 changed files with 28 additions and 0 deletions
28
src/ServerScripts/Example.server.lua
Normal file
28
src/ServerScripts/Example.server.lua
Normal file
|
@ -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()
|
Loading…
Reference in a new issue