Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AresChat/sb0t/llms.txt
Use this file to discover all available pages before exploring further.
Link is a static singleton that exposes the Hub/Leaf linking subsystem to scripts. When sb0t is configured in hub mode, remote servers connect to it as leaves and their users appear in the shared room. When configured in leaf mode, this server connects to a hub and mirrors its user population. Link lets scripts inspect the current connection state, initiate or terminate connections, and iterate the leaf list (hub mode only). All properties return safe defaults — null, -1, or false — when the server is not currently linked.
Properties
true if this server is currently connected to a hub (leaf mode). false when running standalone or acting as a hub. Read-only.The display name of the hub this server is connected to. Returns
null when not linked. Read-only.The external IP address of the hub, as a dotted-decimal string. Returns
null when not linked. Read-only.The port on which the hub is listening. Returns
-1 when not linked. Read-only.A fully-formed
arlnk:// deep-link that resolves to the hub room. Returns null when not linked. Read-only.Methods
Instructs the server to connect to a hub identified by
address. The address may be an IP:port string or an arlnk:// hashlink.| Parameter | Type | Description |
|---|---|---|
address | string | The hub address or arlnk:// hashlink to connect to. |
Disconnects from the currently connected hub. All leaf-user ghost entries are removed from the local user list. Has no effect when not linked.
Iterates over all leaf servers currently connected to this hub and calls
fn(leaf) for each one. Only produces results when this server is operating in hub mode and has active leaf connections. The leaf argument is a Leaf object.| Parameter | Type | Description |
|---|---|---|
fn | function | Callback invoked with a Leaf object for each connected leaf. |
Looks up a single leaf by name and returns its
Returns:
Leaf object, or null if no matching leaf is found. The lookup first tries an exact match, then falls back to a prefix match.| Parameter | Type | Description |
|---|---|---|
name | string | The leaf server name (or name prefix) to search for. |
Leaf object, or null.Leaf Object
EachLeaf object represents one connected leaf server and provides messaging and user-iteration capabilities.
Leaf Properties
The display name of the leaf server. Read-only.
The external IP address of the leaf server. Read-only.
The port the leaf server is listening on. Read-only.
A fully-formed
arlnk:// deep-link that resolves to this leaf’s room. Read-only.Leaf Methods
Iterates over every user connected to this leaf and calls
fn(user) for each one. The user argument is a full User object.| Parameter | Type | Description |
|---|---|---|
fn | function | Callback invoked with a User object for each user on the leaf. |
Finds a single user on this leaf by name. Tries an exact match first, then a prefix match. Returns the
User object or null.| Parameter | Type | Description |
|---|---|---|
name | string | The username (or name prefix) to search for. |
Sends a system message to all users on this leaf. Pass an optional first argument as a virtual room number to restrict delivery to users in that vroom.
| Parameter | Type | Description |
|---|---|---|
text | string | The system message to send. |
Sends a system message only to users on this leaf whose admin level is at or above
level. If only one argument is provided, defaults to Moderator level (1) and above.| Parameter | Type | Description |
|---|---|---|
level | int | Minimum admin level: 1=Mod, 2=Admin, 3=Host. |
text | string | The message to deliver. |
Broadcasts a public chat line to all users on this leaf, attributed to
sender.| Parameter | Type | Description |
|---|---|---|
sender | string | Name to attribute the message to. |
text | string | Message content. |
Broadcasts an emote action line to all users on this leaf, attributed to
sender.| Parameter | Type | Description |
|---|---|---|
sender | string | Name to attribute the emote to. |
text | string | Emote content. |
Sends a scribble drawing to all users on this leaf. The first argument can be either a
JSScribbleImage (sender defaults to Room.botName) or a sender name string followed by a JSScribbleImage.| Parameter | Type | Description |
|---|---|---|
sender | string | JSScribbleImage | Sender name, or the scribble image itself. |
img | JSScribbleImage | Scribble image (only required when sender is a string). |