Skip to content

Discord Webhook

Webhook configuration lives in server/server-config.lua. Changes require a resource restart.

Fields

lua
-- server/server-config.lua

Config.webhook = {
    onStart    = false,   -- fire when the resource starts
    newAd      = true,    -- fire when a new ad is posted
    onDeletion = true,    -- fire when an ad is deleted
}

Config.webHookColors = {
    newAd    = "#1C3C5C",   -- embed sidebar color for new-ad events
    whStart  = "#BBB33C",   -- embed sidebar color for resource-start event
    deleteAd = "#6b150f",   -- embed sidebar color for deletion events
}

Config.whlink  = ''                  -- your Discord webhook URL; empty = webhooks disabled
Config.whName  = 'Ads Logger'        -- webhook bot display name
Config.whLogo  = 'https://...'       -- webhook bot avatar (any public image URL)

Config.whlink is empty by default. All ad-event webhooks are disabled until you supply a URL.

Options

OptionTypeDescription
Config.webhook.onStartbooleanPost a notification when the resource starts.
Config.webhook.newAdbooleanPost a notification when a player publishes a new ad.
Config.webhook.onDeletionbooleanPost a notification when an ad is deleted.
Config.webHookColors.newAdstringHex color for the new-ad embed sidebar.
Config.webHookColors.whStartstringHex color for the resource-start embed sidebar.
Config.webHookColors.deleteAdstringHex color for the deletion embed sidebar.
Config.whlinkstringFull Discord webhook URL. Empty string disables all webhooks.
Config.whNamestringDisplay name of the webhook bot.
Config.whLogostringAvatar image URL for the webhook bot. Any publicly accessible image URL.

Per-category webhook fields

Config.webhookData controls which fields are included in new-ad webhook embeds for each category. All fields default to true. Set any key to false to omit it.

Example — suppress images from job ad webhooks:

lua
Config.webhookData.jobs.images = false

Available keys per category:

CategoryKeys
carsmileage, tuning, title, description, location, price, images, contactName, promoted
itemsprice, amount, title, description, location, images, contactName, promoted
jobsjobTitle, salary, jobRequirements, title, description, location, price, images, contactName, promoted
realEstatespropertyType, houseNumber, title, description, location, images, contactName, promoted
weaponstype, condition, licenseRequired, title, description, images, contactName, promoted
othertype, amount, title, description, images, contactName, promoted

Robicore