Discord Webhooks
The Sky Base library allows integration with Discord through webhooks. This documentation provides details on how to configure Discord webhooks for various Sky-Systems scripts within the sky_base
library.
Configuration Fileβ
The Discord webhook configuration is located in the sky_base/config/sv_config.lua
file. The configuration is structured as a Lua table (SV_Config
) that holds the webhook URLs for different Sky-Systems scripts.
Example Configurationβ
Below is an example configuration for some scripts:
SV_Config = {
webhooks = {
["sky_base"] = "https://discord.com/api/webhooks/",
["sky_camper"] = "https://discord.com/api/webhooks/",
["sky_watchmarket"] = "https://discord.com/api/webhooks/",
["sky_lifeinvader"] = "https://discord.com/api/webhooks/",
["give_coins"] = "https://discord.com/api/webhooks/",
["gen_code"] = "https://discord.com/api/webhooks/",
["cheat_detection"] = "https://discord.com/api/webhooks/",
["purchases"] = "https://discord.com/api/webhooks/",
["redeem"] = "https://discord.com/api/webhooks/",
-- Add other Sky-Systems scripts here
}
}
Webhook Entriesβ
Each entry in the webhooks
table corresponds to a specific Sky-Systems script. The key is the name of the script, and the value is the Discord webhook URL associated with that script.
For example:
"sky_base"
: The webhook URL for the Sky Base script."sky_camper"
: The webhook URL for the Sky Camper script."sky_watchmarket"
: The webhook URL for the Sky Watch Market script.
Adding New Webhooksβ
To add a new webhook for a Sky-Systems script, follow these steps:
- Open the
sky_base/config/sv_config.lua
file in your text editor. - Locate the
webhooks
table within theSV_Config
table. - Add a new entry with the script name as the key and the webhook URL as the value.
Exampleβ
To add a webhook for a new script named sky_sportsbetting
, you would update the webhooks
table as follows:
SV_Config = {
webhooks = {
["sky_base"] = "https://discord.com/api/webhooks/",
["sky_camper"] = "https://discord.com/api/webhooks/",
["sky_watchmarket"] = "https://discord.com/api/webhooks/",
["sky_lifeinvader"] = "https://discord.com/api/webhooks/",
["give_coins"] = "https://discord.com/api/webhooks/",
["gen_code"] = "https://discord.com/api/webhooks/",
["cheat_detection"] = "https://discord.com/api/webhooks/",
["purchases"] = "https://discord.com/api/webhooks/",
["redeem"] = "https://discord.com/api/webhooks/",
-- Add other Sky-Systems scripts here
}
}
Replace YOUR_WEBHOOK_URL_HERE
with the actual webhook URL provided by Discord.
Important Notesβ
- Ensure each webhook URL is correctly formatted and corresponds to an active webhook on your Discord server.
- You can add one webhook for every script which is using the sky_base.
- If you are not using one of the secripts, you can omit it from the
webhooks
table.
Conclusionβ
Configuring Discord webhooks for the Sky Base library is a straightforward process that involves updating the sv_config.lua
file with the appropriate webhook URLs for each script. This integration allows for seamless notifications and interactions between your Sky-Systems scripts and your Discord server.