# 🪝 Discord Match Log

## Discord Match Log

Phoenix Duels can post the result of every finished match to a Discord channel through a webhook. This is a Premium feature.

Results are queued and sent in the background, so a slow or unreachable Discord never holds up a match.

## Setup

### Create the webhook

In Discord, open **Server Settings > Integrations > Webhooks**, create one for the channel you want the results in, and copy its URL.

### Paste it into discord.yml

Open `discord.yml` in the PhoenixDuels folder, put the URL into `match-result.url`, and set `match-result.enabled` to true.

### Reload

Run /pduels reload, then finish a match to confirm the embed arrives.

You can also switch the feature on and off from the editor, under Settings > Plugin Settings > Discord Match Log. The URL itself is only editable in the file.

## discord.yml

```yaml
match-result:
  enabled: false
  url: ''
  username: Phoenix Duels
  avatar-url: ''
  embed:
    title: Duel Results
    color: '#5865F2'
  show-participants: true
```

<table><thead><tr><th width="220">Option</th><th>Description</th></tr></thead><tbody><tr><td>enabled</td><td>Whether finished matches are posted at all.</td></tr><tr><td>url</td><td>The Discord webhook URL. Leave it empty to disable delivery.</td></tr><tr><td>username</td><td>The name the webhook posts under.</td></tr><tr><td>avatar-url</td><td>An image URL used as the webhook's avatar. Leave it empty to use the webhook's own avatar.</td></tr><tr><td>embed.title</td><td>The title line of the embed.</td></tr><tr><td>embed.color</td><td>The colour of the embed's side bar, as a hex value.</td></tr><tr><td>show-participants</td><td>Adds a Participants field listing every team in the match and the players on it. Turn it off to keep the embed to the winner alone.</td></tr></tbody></table>

## The embed

Every result carries the mode, the map, the duel type, the winning team with its players, and how long the match lasted. With show-participants on, a final field lists all teams, one per line:

```
[A] (Foxi)
[B] (kristopher)
```

Players are named as they were when the match started, so someone who logged out mid-duel still appears.

## Troubleshooting

If results are not arriving, check the console after a match finishes. The most common causes are:

* **The URL is empty or malformed.** A webhook URL must be the full `https://discord.com/api/webhooks/...` address, not just a link to the channel.
* **The webhook was deleted in Discord.** Deleting a webhook does not disable the option here, so the plugin keeps posting to an address that no longer exists.
* **Rate limiting.** Discord limits how quickly a single webhook can be posted to. The queue absorbs normal traffic, but sustained bursts can still be throttled by Discord.

> **Info:**
Match logging is separate from match history. Turning it off does not affect the statistics, the match history, or the recaps, which are always recorded.

Source: https://www.phoenixplugins.com/docs/phoenix-duels/features/discord-match-log