Migration to v3¶
Version 3 keeps the v2 feature set and makes the common path easier to read: client aliases, environment constructors, dashboard bundles, log shortcuts, command previews, and model helpers for common list-shaped data.
Install¶
Python import name is unchanged:
Client Names¶
ERLC and AsyncERLC still work. v3 also documents simpler aliases:
from_env() reads ERLC_SERVER_KEY and optional ERLC_GLOBAL_KEY.
Server Data¶
v2 often taught include flags:
bundle = await api.server(players=True, staff=True, queue=True, vehicles=True, emergency_calls=True)
players = bundle.players or []
v3 teaches bundle():
Use api.bundle("all") when you want every supported v2 section. The old
server(... include flags ...) form remains available for exact control.
Logs¶
Before:
After:
logs("all") returns ServerLogs with join_logs, kill_logs,
command_logs, and mod_calls.
Commands¶
Before:
After:
preview = await api.preview_command(cmd.h("Hello"), policy=policy)
if preview.allowed:
await api.command(preview.command, policy=policy)
preview_command(...) never sends HTTP. command(..., policy=policy) validates
before sending.
Models¶
StaffList is now list-like over .members:
ServerBundle keeps optional sections as None when not requested, but v3 adds
safe helpers:
bundle.players_list
bundle.queue_list
bundle.staff_members
bundle.included_sections
bundle.has_section("players")
Checklist¶
- Optionally replace
ERLCwithClientandAsyncERLCwithAsyncClient. - Use
from_env()in examples, bots, and scripts that read environment keys. - Prefer
bundle()over longserver(... flags ...)calls for dashboards. - Prefer
logs("command")andlogs("all")for log workflows. - Use
preview_command(...)andcommand(..., policy=...)for user-triggered commands. - Replace
bundle.players or []withbundle.players_listwhere that reads better.
Related Pages¶
Previous Page: Endpoint Usage Cookbook | Next Page: Migration to v2