How to set webhook system
Webhook System
Webhooks are an essential feature for many it-scripts assets, enabling seamless communication between your server and Discord. They are primarily used to send logs, updates, and other useful information to specific channels in your Discord server.
Fivemanager Integration
Comming Soon (Currently there is no script from us that uses Fivmanager)
Discord Webhooks
Discord webhooks are ideal for logging information, such as:
Player Logs
- Track player actions, such as joining or leaving the server.
- Monitor player interactions with specific assets or features.
Custom Notifications
- Send custom messages or alerts to your Discord server.
- Notify users about important events or updates.
How to set up webhooks
Create a Discord Webhook
Locate the Webhook Configuration
- To make ours scripts more secure the webhook system is located in a sperate file that is only loaded on the server.
- The file is located in
server/sv_webhooks.lua
. - This file contains the configuration settings for the webhook system.
Configure the Webhook
- Open the
sv_webhooks.lua
file in a text editor. - Find the following configuration section:
local webhookSettings = {
['active'] = false, -- Set to true to enable the webhook
['name'] = 'it_referral', -- Name for the webhook
['avatar'] = 'https://i.imgur.com/mbM87BJ.png', -- Avatar for the webhook
['url'] = 'YOUR_WEBHOOK_URL', -- Webhook URL
}
If you want to activate the webhook system, set the active
attribute to true
.
- Replace
YOUR_WEBHOOK_URL
with the actual webhook URL you created in Discord. - You can also customize the
name
andavatar
attributes to personalize the webhook.
Save and Restart
- Save the changes to the
sv_webhooks.lua
file. - Restart the script or the server to apply the changes.
- The webhook system is now active and will send logs to the specified Discord channel.