Aller au contenu

Match poster configuration and generation

Athena can generate a poster from an image template and the results of a Clash of Clans war. Templates can be shared as global defaults or customized for an individual server.

Configure a template

Use /esport-template-config and provide:

  • format: Match 5v5 or Other formats;
  • template: the background image;
  • masque: the black-and-white mask image that marks the field regions;
  • portee: This server or Global default.

The portee option is optional and defaults to This server. Only bot owners can select Global default.

The template and mask must be non-animated PNG, JPEG, or WebP images with exactly matching dimensions. Each image must be at most 15 MB and no larger than 12 million pixels. The mask must have a black background and exactly one separate white region for each field:

  • Other formats: 10 regions — both teams' names, logos, stars, percentages, and times;
  • Match 5v5: 50 regions — 20 player fields per team (name, stars, percentage, time), 6 team result fields (stars, percentage, and time for each team), and 4 team name and logo fields.

Each white region represents one field. In the configuration interface, select the field that matches the region highlighted in red. Fields already assigned are removed from the available choices. Choices are paginated when needed; the save button becomes available once every field has been assigned exactly once.

Saving a template replaces the existing template for the same format and scope. Images and field mappings are stored in the template_image, mask_image, and field_mappings columns of esport_image_templates. The value guild_id = '__default__' identifies a global template; a server ID identifies a server override.

Template priority

For each format, Athena uses a server-specific template when one exists. Otherwise, it uses the global default. Customizing one format does not affect the other.

To restore the global default, a premium manager can use /esport-template-reset and select the relevant format. This removes only that server's custom template; it does not delete the global default.

Test a template

Use /esport-template-test and select a format. The command looks for the server-specific template first and then the global default. It returns only a preview image, with sample values written into the mapped regions (for example, 80% for a percentage). Use it to visually check field placement before a real match poster is generated.

Automatic generation

When the esport automation detects the end of a tracked war, it selects the applicable template and attaches the poster to the result announcement:

  • wars with exactly 5 members on each side use the Match 5v5 template;
  • all other team sizes use the Other formats template.

The poster uses clan names and statistics, clan badges provided by the Clash of Clans API, and, for 5v5 wars, player names and statistics. If a player has multiple attacks, stars are summed, the percentage is averaged across attacks, and attack durations are added together.

If no template is available, the match result is still published without a poster. Poster-generation errors are logged and do not prevent the result embed from being sent.