Discord Webhooks
Discord Webhooks lets the helper post messages to a channel on your Discord server: saved texts with one click and – together with Guild Battlegrounds – sector announcements with their opening time, manually or automatically. If you want to send the sector data to your own server instead, use Web Requests.
Opening
- Menu bar: Discord Webhooks icon (see menu bar).
- In the Guild Battlegrounds window under the gear → Sending tab: as long as no webhook URL is saved, it shows “No Webhooks available. Create one first” with an Open button.
The window never opens by itself.
Creating a webhook in Discord
A webhook is an address that lets programs post into exactly one Discord channel. You create it in Discord in the channel settings under Integrations (you need the permission to manage webhooks on that server) and copy its URL. For several channels, create one webhook per channel.
Warning
Anyone who knows the webhook URL can post in your channel. Don't share it. The helper only stores it locally in your browser.
Managing webhook URLs
At the top of the window, click Manage Webhook URLs to expand or collapse it. If no URL is saved yet, the section is already open.
Save adds the URL. A thread ID is appended to the URL as thread_id=…, so it applies wherever this URL is used. Saved URLs are listed with name and address; Delete removes a URL immediately, without confirmation.
An open Guild Battlegrounds settings pane picks up new or deleted URLs right away.
Messages
Message opens the form for a free text:
- Webhook URL – click a name to choose the target. If there is only one URL, it is already selected; if there is none, it says “Add a webhook URL first!”.
- Message – the text. Discord formatting (bold, italics, emoji with
:name:, timestamps) is passed on exactly as you write it. - Cancel closes the form, Send posts the text immediately (without saving it), Save adds it to the list.
The Discord Messages list shows all saved texts. Each entry has:
Every message shows up in Discord with the sender “FoE Helper” and the helper icon. The helper adds a small line with your player name below it.
Templates
Template opens the form for a named message template for Guild Battlegrounds:
- Name – you pick the template by this name in the Guild Battlegrounds settings.
- Message – the text with
placeholders . Prefilled with:robot: #battletype **#name** <t:#time:R>. - Below the field you find the available placeholders and a link to Discord text formatting.
- Cancel / Save.
Templates have no webhook URL of their own and no Send button – they are only sent from Guild Battlegrounds. In the list they show their name in bold before the text and have the same Copy, Edit and trash can buttons as messages.
Note
Guild Battlegrounds remembers a template by its name. If you rename or delete a template, select it again in the Guild Battlegrounds settings.
Placeholders
When sending, the helper replaces these placeholders with the sector's data:
Warning
Victory points, neighbors and attrition can change until the sector opens. The message contains the values at the time of sending.
The same placeholders are available in Web Requests.
Using it in Guild Battlegrounds
In the Guild Battlegrounds window, open the gear (see window buttons) and switch to the Sending tab. In the Discord Webhooks section you set:
Save applies the selection. After that, the live overview shows these buttons in the list of upcoming sectors for every sector that doesn't belong to your guild:
- Send to Discord – sends the standard announcement: battle type color (only if Attack colors is on under Copying in the GBG gear), sector name in bold, time and remaining time until the opening.
- Send to Discord with template – only if a template for single sectors is selected; sends the sector using that template.
Click rows to select them. Above the list you then get Send selected provinces to Discord and – if a template for multiple provinces is selected – Send selected provinces to Discord with selected template. Both send all selected sectors as one message, one line per sector, sorted by opening time.
Sending automatically
With Send sectors automatically turned on, the helper announces every enemy sector adjacent to your guild that is still locked, once, to the selected webhook – the configured lead time before it opens.
- Lead time (seconds): 5 to 3600, default 60.
- Skip at attrition chance of (%): 20 to 100, default 100. If the sector's attrition chance is at or above this value at the time of sending, the announcement is skipped. If it drops afterwards and another map update arrives before the opening, the sector is announced then.
- If a template for single sectors is selected, it is used; otherwise the standard announcement.
- Each sector is announced only once per lock period.
- The schedule is rebuilt every time the Guild Battlegrounds window is rebuilt. Keep the window open: if you close it, announcements already scheduled are not sent either.
Note
Ideally only one guild member turns this on – otherwise every announcement ends up in the channel several times.
Settings
The window has no gear of its own. Which webhook URL and templates Guild Battlegrounds uses and whether sectors are sent automatically is set in the Guild Battlegrounds settings (see
FAQ
The success message appeared, but nothing arrived in Discord. The helper doesn't check Discord's response; the message always appears. Check the webhook URL and thread ID – and whether the webhook still exists in Discord.
The Discord buttons are missing in Guild Battlegrounds. The buttons only appear once a webhook URL is selected and saved in the Sending tab, and only for sectors that don't belong to your guild. Send to Discord with template only exists if the selected template still exists under that name.
I want to post to different channels. Create one webhook per channel and save each URL under its own name. For messages you choose the target per entry; Guild Battlegrounds sends to exactly one URL.
See also
- Web Requests – sector data to your own server instead of Discord
- Guild Battlegrounds
- Window buttons
- Menu bar