# Discord Webhook Builder

Generate a ready-to-use Discord logging function with a proper embed, plus the server.cfg line that keeps the webhook URL out of your resource.

- Platform: FiveM
- Canonical page: https://devtoolsgg.com/fivem/discord-webhook
- Writes to: server.lua goes in your resource; the convar line goes in server.cfg.

## Options

### Setup

- `name` Function name (required). The Lua function this generates, e.g. sendLog.
- `convar` Convar name (required). Server convar holding the webhook URL. Never hardcode the URL itself.
- `username` Bot username. Name shown as the message author in Discord.
- `avatar` Avatar URL. Optional image used as the author avatar.

### Embed

- `color` Embed colour. Left border colour of the embed.
- `timestamp` Timestamp. Adds the current UTC time to the embed footer.
- `footer` Footer text. Small line at the bottom of the embed.
- `thumbnail` Thumbnail URL. Small image in the top-right of the embed.

### Embed fields

- `fields` Fields. Each row becomes a labelled value inside the embed.

## How to cite

Discord Webhook Builder, devtoolsgg.com. https://devtoolsgg.com/fivem/discord-webhook
