Whether the client has been disconnected. If true, the client needs to be reconnected with .reconnect()
or destroyed
Raw ribbon handler for sending messages.
Optional
gameThe game the client is currently in if it is in a game.
Raw ribbon handler.
Raw ribbon handler.
Raw ribbon handler. You likely want to use client.wait
instead.
Raw ribbon client, the backbone of TETR.IO multiplayer. You probably don't want to touch this unless you know what you are doing.
Optional
roomThe room the client is in (if it is in a room). You can make it non-nullable with client.room!
A helpful manager for all things social on TETR.IO (friends, dms etc.)
The client's token
User information
Utils for the client.
Reconnect the client to TETR.IO.
Send a message and then wait for another message. Throws an error if a 'err' message is received before the response message
the command
of the event to send
the data to send along with the command. For void (no) data, just pass in undefined
the event to wait for before resolving.
a list of custom error events to listen for. Defaults to [client.error]
.
the data sent by the listen
event
an error if the error event provided (or client.error
) is received from TETR.IO
Static
connectCreate a new client
Useful for connecting to the main game API when none of the client helpers have the request you want to send. You can use
client.api.get
andclient.api.post
to easily send GET and POST requests.