Events
What dzbot can tell your bot about. The same events reach webhooks and live events.
// CatalogThe catalog
Every event with its description, the payload's schema, a sample and the rights that open it — no key needed:
https://api.dzbot.de/api/developer/events
The SDK's types are generated from it. Narrow an event to its payload with isEvent:
import { isEvent, type DzbotEvent } from '@dzbot/sdk'
if (isEvent(event, 'transaction.created')) console.log(event.payload.transaction.amount, event.payload.newBalance)
function onKill(event: DzbotEvent<'log.player_kill'>) { /* … */ }Each event has a scope: server events happen on one server (serverId is set), organization events belong to the whole organization (wallet transactions, reviews). Player ids in payloads are the player's id on the server, the one the API and the admin area use.
// dzbotWhat happens in dzbot
| Event | When | Readable with |
|---|---|---|
action.ran | An action finished running — triggered by its log event or run by a scheduler task — successfully or not. `logTail` is the end of what it printed, where an error shows up. | admin.actions.view |
order.canceled | A shop order was canceled before delivery and its price refunded. | admin.orders.view |
order.created | A shop order was placed — by a player, given by the support team, or as a redelivery of an earlier order (`order.redeliveryOfOrderId`). It is delivered with a later server restart. | admin.orders.view |
order.delivered | A shop order was written to the server and will spawn with this restart. | admin.orders.view |
order.delivery_reverted | A delivered shop order was taken back: the restart that should have spawned it failed, so it waits for the next one. | admin.orders.view |
order.refunded | A shop order was refunded completely. A canceled order is refunded too but fires order.canceled instead. | admin.orders.view |
review.opened | A support review (multi_account, fresh_account, account_sharing, device_switch) was opened, or reopened by a new member or incident (`entryType` opened / reopened). `members` are the organization players it is about. | admin.reviews.view |
review.resolved | A support review was decided; `noteExcerpt` is the start of the decision note. | admin.reviews.view |
ticket.created | A ticket was opened — by a player, by the support team (`byModerator`), by an action or by the companion. | admin.tickets.view, admin.tickets.reply, admin.tickets.internal_message, admin.tickets.assign, admin.tickets.change_status, admin.tickets.add_participant |
ticket.message_added | Somebody wrote in a ticket — a player, the support team (`byModerator`) or an internal note (`internal`), on the web or in Discord. The opening message is part of ticket.created instead. | admin.tickets.view, admin.tickets.reply, admin.tickets.internal_message, admin.tickets.assign, admin.tickets.change_status, admin.tickets.add_participant |
ticket.status_changed | A ticket changed status (open, in_progress, closed, archived) — by hand, or to in_progress when the support team first answers. Closing with auto-archive on fires twice: closed, then archived. | admin.tickets.view, admin.tickets.reply, admin.tickets.internal_message, admin.tickets.assign, admin.tickets.change_status, admin.tickets.add_participant |
transaction.created | Money moved in a player wallet (`transaction.amount` is negative when it was taken). `player` owns the wallet, `origin` is who it moved on — they differ only for an alt account whose money goes to its main. | admin.transactions.view, admin.players.view |
// GameWhat happens in the game
One event per kind of line in the server logs, as soon as dzbot has read them (Nitrado hands the logs out every 5–15 minutes). payload.data is the same data dzbot's own actions get.
| Event | When | Readable with |
|---|---|---|
log.base_detected | Fires when a player's base is detected on the map. | admin.logs.view |
log.placement | Fires when a player places an item or object in the world. | admin.logs.view |
log.player_bled_out | Fires when a player bleeds out and dies. | admin.logs.view |
log.player_build_base | Fires when a player builds a base part. | admin.logs.view |
log.player_cleared_rubble | Fires when a player clears rubble off a ruined map building. | admin.logs.view |
log.player_committed_suicide | Fires when a player commits suicide. | admin.logs.view |
log.player_connected | Fires when a player connects to the server. | admin.logs.view |
log.player_destroyed_base | Fires when a player destroys a whole base structure at once, for example a fence with a chainsaw. | admin.logs.view |
log.player_died | Fires when a player dies. | admin.logs.view |
log.player_disconnected | Fires when a player disconnects from the server. | admin.logs.view |
log.player_disconnecting_unconscious | Fires when a player disconnects while unconscious. | admin.logs.view |
log.player_dismantled_base | Fires when a player dismantles a base part. | admin.logs.view |
log.player_dismantled_building | Fires when a player dismantles a rebuilt part of a map building, such as a wooden door or window. | admin.logs.view |
log.player_drowned | Fires when a player drowns. | admin.logs.view |
log.player_folded_item | Fires when a player folds up an item. | admin.logs.view |
log.player_hit_by_animal | Fires when a player is hurt by an animal — a wolf, a bear or a dog. | admin.logs.view |
log.player_hit_by_barbed_wire | Fires when a player is hit by barbed wire. | admin.logs.view |
log.player_hit_by_environment | Fires when a player is hurt by the environment. | admin.logs.view |
log.player_hit_by_explosion | Fires when a player is hit by an explosion. | admin.logs.view |
log.player_hit_by_fall | Fires when a player takes fall damage. | admin.logs.view |
log.player_hit_by_fire | Fires when a player is hurt by fire. | admin.logs.view |
log.player_hit_by_infected | Fires when a player is hurt by an infected. | admin.logs.view |
log.player_hit_by_player | Fires when a player is hit by another player (without dying). `flags.friendly_fire` is true when both are in the same faction. | admin.logs.view |
log.player_hit_by_trap | Fires when a player steps into a trap, such as a bear trap. Tripwires have their own event. | admin.logs.view |
log.player_hit_by_vehicle | Fires when a player is hit by a vehicle. | admin.logs.view |
log.player_hit_player | Fires when a player hits another player (without killing them). `flags.friendly_fire` is true when both are in the same faction. | admin.logs.view |
log.player_identification | Fires when a player's device is identified on connection. | admin.logs.view |
log.player_kill | Fires when a player kills another player. `flags` tells what made the kill special: headshot, revenge, trade, multi_kill (2, 3 or 4+ kills by the killer within 45 s, nil for a single kill), team_kill, alliance_violation (killer and victim belong to allied factions) and spawn_kill. | admin.logs.view |
log.player_killed | Fires when a player is killed by another player, from the victim's perspective. `flags` carries the same kill context as player_kill. | admin.logs.view |
log.player_killed_by_environment | Fires when a player is killed by the environment. | admin.logs.view |
log.player_killed_by_infected | Fires when a player is killed by an infected. | admin.logs.view |
log.player_login_info | Fires when a player logs in, with their place in the login queue, whether they had queue priority and, on Xbox servers, whether they play on a console or a Windows PC (`desktop`). | admin.logs.view |
log.player_lowered_flag | Fires when a player lowers a territory flag. | admin.logs.view |
log.player_online | Fires periodically while a player is online to report their presence. | admin.logs.view |
log.player_packed_item | Fires when a player packs an item using a tool. | admin.logs.view |
log.player_performed_emote | Fires when a player performs an emote. | admin.logs.view |
log.player_raised_flag | Fires when a player raises a territory flag. | admin.logs.view |
log.player_ran_into_tripwire | Fires when a player runs into a tripwire trap. | admin.logs.view |
log.player_rebuilt_building | Fires when a player rebuilds part of a ruined map building: a wall, door, window, roof, ladder or well. Clearing rubble is player_cleared_rubble. | admin.logs.view |
log.player_regained_consciousness | Fires when a player regains consciousness. | admin.logs.view |
log.player_repaired_base | Fires when a player repairs a base structure. | admin.logs.view |
log.player_respawn | Fires when a player respawns. | admin.logs.view |
log.player_stash | Fires when a player stores or retrieves an item from a stash. | admin.logs.view |
log.player_teleported | Fires when a player is teleported. | admin.logs.view |
log.player_unconscious | Fires when a player falls unconscious. | admin.logs.view |
log.subscription_spawn_failed | Fires when the game server could not spawn a player's or faction's shop subscription — usually because the chosen spot is blocked. Any charge for that restart is refunded automatically. | admin.logs.view |