Discord Integration
CTFGarden can integrate with Discord to provide interactivity during the CTF.
Notifications
The following notifications are currently supported:
Public notifications
These notifications are intended to be public, so they include no sensitive information.
- Solves - Sent when a team/user solves a challenge. Contains the team and user name and challenge name.
- Bloods - Sent when a team/user solves a challenge that no other team/user has solved before. Contains the same information as the Solves notification.
- Invalid submissions - Sent when a team/user submits an invalid flag. Contains the team and user name and challenge name.
Private notifications
These notifications may contain sensitive information, so they should only be sent to a private channel.
- Solves + Flags - Sent when a team/user solves a challenge. Contains the team and user name, challenge name, and the submitted flag.
- Invalid submissions + Flags - Sent when a team/user submits an invalid flag. Contains the team and user name, challenge name, and the submitted flag.
- Writeup submissions - Sent when a team/user submits a writeup. Contains the team and user name, challenge name, and the submitted writeup.
If a submitted flag is valid but belongs to a different team/user (see actor flags), the private invalid submission notification also includes a warning about possible flag sharing.
Decoys and cheaters
Some submissions are never announced in the public channels (Solves, Bloods and Invalid submissions):
- Submissions for decoy challenges, so players don't learn which challenges are decoys. The private notifications mark them with a
[DECOY]prefix in front of the challenge name. - Submissions of players who are flagged as cheaters, or whose team is. Their private notifications are still sent.
Solves of flagged players are also ignored when deciding whether a solve is a blood, so the first solve by a team that isn't flagged is announced as the blood.
Configuration
To enable the Discord integration, create a Discord bot, invite it to your server and give it permission to send messages in the channels you want to use.
Then, set the following environment variables on the API server:
| Variable | Description |
|---|---|
DISCORD_TOKEN | The token of your bot. If this is not set, the Discord integration is disabled. |
DISCORD_SOLVES_CHANNEL_ID, DISCORD_SOLVES_GUILD_ID | Channel and server for Solves notifications |
DISCORD_BLOODS_CHANNEL_ID, DISCORD_BLOODS_GUILD_ID | Channel and server for Bloods notifications |
DISCORD_PUBLIC_INVALID_SUBMISSIONS_CHANNEL_ID, DISCORD_PUBLIC_INVALID_SUBMISSIONS_GUILD_ID | Channel and server for Invalid submissions notifications |
DISCORD_PRIVATE_SOLVES_CHANNEL_ID, DISCORD_PRIVATE_SOLVES_GUILD_ID | Channel and server for Solves + Flags notifications |
DISCORD_PRIVATE_INVALID_SUBMISSIONS_CHANNEL_ID, DISCORD_PRIVATE_INVALID_SUBMISSIONS_GUILD_ID | Channel and server for Invalid submissions + Flags notifications |
DISCORD_WRITEUP_CHANNEL_ID, DISCORD_WRITEUP_GUILD_ID | Channel and server for Writeup submissions notifications |
Each notification is only sent if both its channel and server ID are set. You can get these IDs by enabling developer mode in Discord and right-clicking the channel or server.