DZDEV
// SDK · Events

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

EventWhenReadable with
action.ranAn 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.canceledA shop order was canceled before delivery and its price refunded.admin.orders.view
order.createdA 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.deliveredA shop order was written to the server and will spawn with this restart.admin.orders.view
order.delivery_revertedA 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.refundedA shop order was refunded completely. A canceled order is refunded too but fires order.canceled instead.admin.orders.view
review.openedA 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.resolvedA support review was decided; `noteExcerpt` is the start of the decision note.admin.reviews.view
ticket.createdA 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_addedSomebody 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_changedA 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.createdMoney 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.

EventWhenReadable with
log.base_detectedFires when a player's base is detected on the map.admin.logs.view
log.placementFires when a player places an item or object in the world.admin.logs.view
log.player_bled_outFires when a player bleeds out and dies.admin.logs.view
log.player_build_baseFires when a player builds a base part.admin.logs.view
log.player_cleared_rubbleFires when a player clears rubble off a ruined map building.admin.logs.view
log.player_committed_suicideFires when a player commits suicide.admin.logs.view
log.player_connectedFires when a player connects to the server.admin.logs.view
log.player_destroyed_baseFires when a player destroys a whole base structure at once, for example a fence with a chainsaw.admin.logs.view
log.player_diedFires when a player dies.admin.logs.view
log.player_disconnectedFires when a player disconnects from the server.admin.logs.view
log.player_disconnecting_unconsciousFires when a player disconnects while unconscious.admin.logs.view
log.player_dismantled_baseFires when a player dismantles a base part.admin.logs.view
log.player_dismantled_buildingFires when a player dismantles a rebuilt part of a map building, such as a wooden door or window.admin.logs.view
log.player_drownedFires when a player drowns.admin.logs.view
log.player_folded_itemFires when a player folds up an item.admin.logs.view
log.player_hit_by_animalFires when a player is hurt by an animal — a wolf, a bear or a dog.admin.logs.view
log.player_hit_by_barbed_wireFires when a player is hit by barbed wire.admin.logs.view
log.player_hit_by_environmentFires when a player is hurt by the environment.admin.logs.view
log.player_hit_by_explosionFires when a player is hit by an explosion.admin.logs.view
log.player_hit_by_fallFires when a player takes fall damage.admin.logs.view
log.player_hit_by_fireFires when a player is hurt by fire.admin.logs.view
log.player_hit_by_infectedFires when a player is hurt by an infected.admin.logs.view
log.player_hit_by_playerFires 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_trapFires when a player steps into a trap, such as a bear trap. Tripwires have their own event.admin.logs.view
log.player_hit_by_vehicleFires when a player is hit by a vehicle.admin.logs.view
log.player_hit_playerFires 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_identificationFires when a player's device is identified on connection.admin.logs.view
log.player_killFires 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_killedFires 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_environmentFires when a player is killed by the environment.admin.logs.view
log.player_killed_by_infectedFires when a player is killed by an infected.admin.logs.view
log.player_login_infoFires 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_flagFires when a player lowers a territory flag.admin.logs.view
log.player_onlineFires periodically while a player is online to report their presence.admin.logs.view
log.player_packed_itemFires when a player packs an item using a tool.admin.logs.view
log.player_performed_emoteFires when a player performs an emote.admin.logs.view
log.player_raised_flagFires when a player raises a territory flag.admin.logs.view
log.player_ran_into_tripwireFires when a player runs into a tripwire trap.admin.logs.view
log.player_rebuilt_buildingFires 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_consciousnessFires when a player regains consciousness.admin.logs.view
log.player_repaired_baseFires when a player repairs a base structure.admin.logs.view
log.player_respawnFires when a player respawns.admin.logs.view
log.player_stashFires when a player stores or retrieves an item from a stash.admin.logs.view
log.player_teleportedFires when a player is teleported.admin.logs.view
log.player_unconsciousFires when a player falls unconscious.admin.logs.view
log.subscription_spawn_failedFires 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