Docs /
Attack alerts in Discord and Telegram
Get a message in your staff channel the moment filtering starts, when an attack ends, when the edge loses your server and when a payment fails. Discord, Telegram or your own endpoint.
What you get
Each alert channel sends the events you tick. A Discord or Telegram message names the service and the event and ends with a link to it in the panel.
| Event | Sent when |
|---|---|
attack_started | The edge starts filtering an attack on one of your services |
attack_ended | That attack is over |
service_down | A live service turns degraded or stops answering |
service_up | The service is back to active |
payment_failed | A renewal or a retry of your plan's payment was declined |
Alert channels are on the Notifications page: in the panel open Account, then Notifications. They sit above the email and in-panel switches. Every team member can see the list of channels; only owners and admins add, edit, test and delete them. An account can have up to 10 channels. Discord and Telegram messages are written in the account owner's language, English or Traditional Chinese.
Discord
In Discord open Server Settings, then Integrations, then Webhooks.
Choose New Webhook, name it
ZEROPINGand pick the channel the alerts should post in.Choose Copy Webhook URL. It starts with
https://discord.com/api/webhooks/.In the panel, under Alert channels, choose Add channel, then Discord. Give the channel a name, paste the URL and tick the events. A common split: attacks and service state to the staff channel, payment failures to the owners' channel.
Choose Add channel, then Send test. The panel shows whether Discord accepted it, and a test message appears in the channel.
Telegram
Telegram needs a bot that may post in your chat, plus the id of that chat.
In Telegram message @BotFather, send
/newbotand follow the steps. The username must end inbot. BotFather replies with a bot token that looks like123456789:AA….Add the bot to your staff group. For a channel, add it as an administrator. Then send one message there.
Open the address below in a browser, with your own token in place of
<token>:Browser https://api.telegram.org/bot<token>/getUpdatesFind
"chat":{"id":…}in the reply and copy the number. Group and channel ids start with-100, for example-1001234567890. A public channel's@nameworks too.In the panel choose Add channel, then Telegram, and paste the bot token and the chat id. Tick the events and choose Add channel.
Choose Send test.
If getUpdates returns an empty list, send another message in the group and reload. A bot only sees messages sent after it joined.
Your own endpoint (signed webhook)
For anything else, from a staff bot to your own dashboard, add a Webhook channel. ZEROPING sends each event as an HTTPS POST with a JSON body.
Run an HTTPS endpoint on a public address that accepts
POSTwith a JSON body. Private, local and bare IP addresses are refused, and so is a URL with a user name or password in it.In the panel choose Add channel, then Webhook, and enter the endpoint URL.
Choose Add channel. The panel shows the signing secret once. It starts with
whsec_; store it with your endpoint's other secrets.Choose Send test. Your endpoint receives an event called
test.
Every request carries these headers:
| Header | Value |
|---|---|
X-ZP-Event | The event, for example attack_started |
X-ZP-Delivery | The id of this delivery, also id in the body; a retry keeps it |
X-ZP-Timestamp | When the request was signed, in Unix seconds |
X-ZP-Signature | v1= followed by the hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with your signing secret |
{
"id": "01938a2c-7d1e-7f00-9c4b-5e2a8d6f1b30",
"event": "attack_started",
"occurred_at": "2026-11-29T19:04:11Z",
"account_id": "01937f5e-2a4b-7c3d-8e9f-0a1b2c3d4e5f",
"data": {
"property_id": "01937f61-0000-7000-8000-000000000001",
"service": "Survival SMP",
"attack_id": "01938a2c-7d00-7000-8000-00000000a001",
"vector": "UDP flood",
"vector_code": "udp_flood",
"location": "Hong Kong",
"location_code": "hkg",
"link": "/app/attacks/01938a2c-7d00-7000-8000-00000000a001"
}
} data depends on the event. Every event carries link, the path of the matching page in the panel (add your panel's address in front of it).
| Event | Fields in data |
|---|---|
attack_started, attack_ended | property_id, service, attack_id, vector, vector_code, location, location_code, link |
service_down, service_up | property_id, service, status (degraded, error or active), link |
payment_failed | invoice_id, invoice_number, amount_cents, currency, link |
vector and location are display names in English. For logic, use vector_code (udp_flood, syn_flood, http_flood or amplification) and location_code (for example hkg), which never change.
If you lose the secret, open the channel's Edit form and tick Issue a new signing secret. The old one stops working at once.
Verify the signature
Check the signature before you trust the body. Compute it over the raw bytes you received, before any JSON parsing, and refuse requests whose timestamp is more than five minutes old, so a captured request cannot be replayed.
import { createHmac, timingSafeEqual } from 'node:crypto';
import { createServer } from 'node:http';
const SECRET = process.env.ZP_WEBHOOK_SECRET;
function verify(rawBody, headers) {
const ts = headers['x-zp-timestamp'] ?? '';
const got = Buffer.from(headers['x-zp-signature'] ?? '');
if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const mac = createHmac('sha256', SECRET).update(`${ts}.`).update(rawBody).digest('hex');
const want = Buffer.from(`v1=${mac}`);
return got.length === want.length && timingSafeEqual(got, want);
}
const seen = new Set(); // use your database in production
createServer((req, res) => {
const chunks = [];
req.on('data', (c) => chunks.push(c));
req.on('end', () => {
const raw = Buffer.concat(chunks);
if (!verify(raw, req.headers)) return res.writeHead(401).end();
res.writeHead(204).end(); // answer first, then work
const event = JSON.parse(raw);
// De-duplicate on the body's id: it is covered by the signature, the X-ZP-Delivery header is not.
if (seen.has(event.id)) return;
seen.add(event.id);
console.log(event.event, event.data.service);
});
}).listen(8080); import hashlib, hmac, os, time
SECRET = os.environ["ZP_WEBHOOK_SECRET"].encode()
def verify(raw_body: bytes, headers) -> bool:
ts = headers.get("X-ZP-Timestamp", "")
got = headers.get("X-ZP-Signature", "")
if not ts.isdigit() or abs(time.time() - int(ts)) > 300:
return False
mac = hmac.new(SECRET, ts.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(got, "v1=" + mac) Answer with any 2xx status within 5 seconds and do slow work afterwards. A delivery that fails is tried up to 6 times in all, with growing gaps; a 4xx answer other than 408 or 429 stops the retries at once, so do not answer 4xx to a request you simply could not handle yet. A retry carries the same body id (and X-ZP-Delivery header), with a new timestamp and signature. Handle each body id once, after the signature check: the body is signed, the headers other than the timestamp are not, so never de-duplicate on X-ZP-Delivery alone.
Test and troubleshoot
- Send test goes to that channel only, right away, and never changes a service. The test message names no service or event. You can test a channel you have switched off. The panel allows 10 tests a minute per account.
- Each channel shows its last delivery: delivered with the HTTP status, or why it failed (no answer within 5 seconds, address not reachable or not public, an HTTP error, or the destination limiting requests).
- Discord or Telegram stays silent: check that the webhook still exists, or that the bot is still in the chat and allowed to post.
- Your endpoint answers
401: make sure you sign the raw body exactly as received, and that the server clock is right. A clock that is minutes off fails the five-minute check. - Too many messages: untick
service_upandattack_endedfor busy channels and send them to a quieter log channel.
Was this helpful?