Discord webhook logging

FireScript V2 can post every fire event to a Discord channel — fires started and stopped, incidents raised and cleared, who did what.

It needs a small helper resource to do the posting. DiscordWebhooks ships with the package.

1. Start the helper resource

Add it to your server.cfg before firescriptv2:

ensure discordwebhooks
ensure firescriptv2

On start it prints:

DiscordWebhooks: Loaded Successfuly

If you do not see that line, it has not started and no logging will work.

2. Create the webhook in Discord

  1. Open the Discord channel you want the logs in
  2. Edit Channel › Integrations › Webhooks › New Webhook
  3. Give it a name and pick the channel
  4. Copy Webhook URL

It looks like https://discord.com/api/webhooks/<id>/<token>.

Treat that URL as a password. Anyone who has it can post into your channel. Never put it in a public repo, a screenshot, or a support ticket.

3. Put it in the config

In firescriptv2/config.lua:

Config.Discord = {
    UseWebHooks = true,
    WEB_HOOK    = "https://discord.com/api/webhooks/your/url/here",
    STEAM_API   = "",
    WEB_IMAGE   = "https://your-cdn/logo.png",
    BOT_NAME    = "FireScript Logger",
}
  • UseWebHooks — the master switch. Leave it false if you are not using Discord logging, or the script tries to register a webhook that does not exist
  • WEB_HOOK — your webhook URL from step 2. Ships empty on purpose — put your own in
  • STEAM_API — optional Steam API key. With one, log entries can resolve a player's Steam profile. Leave empty to skip
  • WEB_IMAGE — thumbnail shown on each embed. Any public image URL
  • BOT_NAME — the name posts appear under in Discord

4. Restart and check

Restart firescriptv2 and start a fire with /startfire. You should see the registration line in the server console:

DiscordWebhooks: Webhook 'FireScript Logger' Registered!

…and the fire appear in your Discord channel.

Using your own webhook resource

You do not have to use ours. FireScript registers its webhook by raising an event, so any resource that listens for it will work:

TriggerEvent("dw:registerWebhook", webhookUrl, botName, imageUrl, function(id)
    -- return a handle the logger can post with
end)

If you already run a webhook resource that handles dw:registerWebhook, drop ours and keep yours.

Troubleshooting

Nothing is posted, no errors. Check UseWebHooks = true, and that discordwebhooks started before firescriptv2 — look for both console lines above.

"Webhook Registered!" appears but nothing reaches Discord. The URL is wrong or the webhook was deleted in Discord. Recreate it and paste the new URL.

Only some events appear. Fires created by natural spread do not raise their own log entry — they belong to the fire they grew from. That is Config.FireWarnings.IgnoreSpreadFires; set it false to log every single fire.

Too much noise. Leave IgnoreSpreadFires on, and turn on GroupIncidentFires so a four-fire scenario logs as one incident instead of four.

Can't find what you need? Ask on Discord — response in under 5 hours.