rCTF Docs
Overview

Blood bot

Configure first blood announcements to Discord and Telegram.

The blood bot posts an announcement to Discord or Telegram channels (or both) when teams land an early solve on a challenge.

Configuration#

rctf.d/bloodbot.yaml
bloodBot:
bloodsCount: 3
destinations:
- provider:
name: messages/discord
options:
url: https://discord.com/api/webhooks/123456/abcdef
- provider:
name: messages/telegram
options:
botToken: '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'
chatId: '-1001234567890'
FieldTypeDefaultDescription
bloodsCountnumber1Number of blood tiers to announce (1-3)
destinationsarray-At least one destination required

bloodsCount set to 3 announces first, second, and third blood. Set it to 1 and only first blood gets announced.

Message providers#

Posts announcements through a Discord webhook.

OptionDescription
urlDiscord webhook URL

To create a webhook, navigate to Server Settings > Integrations > Webhooks > New Webhook, then copy the webhook URL.

Posts announcements through a Telegram bot.

OptionDescription
botTokenTelegram bot token (from @BotFather)
chatIdTarget chat or group ID
threadIdMessage thread ID for forum/topic channels (optional)

Custom message templates#

Each destination can have a custom messageTemplate:

bloodBot:
bloodsCount: 1
destinations:
- provider:
name: messages/discord
options:
url: https://discord.com/api/webhooks/...
messageTemplate: '{{teamName}} got {{bloodNumSentence}} blood on {{challengeCategory}}/{{challengeName}}!'

Template variables#

VariableDescriptionExample
{{teamName}}Team display nameSuperHackers
{{teamUrl}}URL to team profilehttps://ctf.example.com/users/abc123
{{bloodNumSentence}}Blood ordinalfirst, second, third
{{challengeCategory}}Challenge categoryweb
{{challengeName}}Challenge nameSQL Injection 101

Default templates#

When no custom template is set, the defaults kick in.

The Discord default is Congratulations to [`{{teamName}}`]({{teamUrl}}) for {{bloodNumSentence}} blood on `{{challengeCategory}}/{{challengeName}}`!.

The Telegram default is Congratulations to [*{{teamName}}*]({{teamUrl}}) for {{bloodNumSentence}} blood on `{{challengeCategory}}/{{challengeName}}`\!.

The Telegram template uses MarkdownV2 syntax and escapes the ! character, which the Telegram API requires.

Esc

Start typing to search the docs.