Skip to main content

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/",
-- 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:

  1. Open the sky_base/config/sv_config.lua file in your text editor.
  2. Locate the webhooks table within the SV_Config table.
  3. 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_sportsbetting"] = "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL_HERE",
-- 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.