User Representation
USER represents a user with their rank as the first character (users with no rank use a space), followed by their username.
Optionally, USER may be appended with @ followed by a status message, or @! to indicate the user is away.
Room Initialization
Init
ROOMTYPE is one of:
chat- A chat roombattle- A battle room
Title
For example, room
battle-gen7uu-779767714 could have title Alice vs. Bob.Users List
USERLIST is a comma-separated list of USERs.
Room Messages
Raw Message
MESSAGE directly in the room log.
HTML Message
Updatable HTML
|uhtml| message.
Join
USER joined the room.
- Lowercase
jis for normal display - Uppercase
Jindicates high-frequency events that should not be displayed inline
Leave
USER left the room.
Name Change
USER from OLDID.
Chat
USER said MESSAGE.
Special Messages
IfMESSAGE starts with /, it’s a special command:
/me TEXT- Action message/announce TEXT- Announcement/uhtml HTML- HTML in PM (stopgap before client rewrite)
If the server wants to render a message starting with
/, it will send it starting with //.Timestamped Chat
|c| but includes a UNIX timestamp for accurate chat logs.
Notify
TITLE is usually bold, MESSAGE is optional.
HIGHLIGHTTOKEN would trigger the user’s highlight settings.
Battle Started
USER1 and USER2 in room ROOMID.
Global Messages
Popup
MESSAGE. || denotes a newline.
Private Message
SENDER to RECEIVER.
User Count
Name Taken
USERNAME failed for the reason in MESSAGE.
Authentication
Challenge String
Update User
USER- Your rank and usernameNAMED-0if guest,1otherwiseAVATAR- Your avatar identifierSETTINGS- JSON object with user settings
Format and Search Messages
Formats List
FORMATSLIST is pipe-separated with these suffixes:
,#- Uses random teams,,- Only available for searching,- Only available for challenging
|| with column numbers.
Update Search
JSON represents the current state of battle searches.
Example:
Update Challenges
JSON represents current challenge state.
Example:
Query Response
/query QUERYTYPE commands.
Possible queries:
/query roomlist- List of rooms/query userdetails USERNAME- User information
Challenge System
Sending a Challenge
TEAM is in packed format or null for formats like Random Battle.Accepting a Challenge
Rejecting a Challenge
Canceling a Challenge
Ladder System
Starting a Search
Canceling a Search
Tournament Messages
Create Tournament
FORMAT- Battle format nameGENERATOR-EliminationorRound Robin- Elimination includes prefix:
Single,Double, etc. - Round Robin includes
Doubleprefix if matchups battle twice
- Elimination includes prefix:
PLAYERCAP- Maximum players, or0for no cap
Tournament Update
Tournament Events
USER joined the tournament.
USER left the tournament.
OLD was replaced with NEW.
NUMPLAYERS participants.
USER was disqualified.
Tournament Battles
USER1 and USER2.
RESULT- FromUSER1’s perspective:win,loss, ordrawSCORE- Array[USER1_POKEMON_LEFT, USER2_POKEMON_LEFT]RECORDED-successorfail(if bracket doesn’t support draws)
Tournament Settings
allow or disallow.
TIMEOUT seconds.
TIMEOUT seconds.
TIME seconds to act or be disqualified.
Next Steps
Battle Protocol
Learn about battle-specific message types
Choice Requests
Understand how to make decisions in battles
