Skip to main content

View as Markdown · AI documentation index

Type Alias: ChatVars

ChatVars = object

Defined in: types.ts:212

Persisted state of a single chat.

Remarks​

Everything that can change during play lives here; defineChat() only supplies the initial values. A chat that is missing from an older save is materialized from its definition on first access, so adding a chat to a game never needs a save migration.

Properties​

activeScriptId​

activeScriptId: string | null

Defined in: types.ts:216

Script currently being played, if any.


avatar?​

optional avatar: string | null

Defined in: types.ts:244

In-fiction avatar. null means the avatar was explicitly removed.


beatCounts​

beatCounts: Record<string, number>

Defined in: types.ts:222

Raw beat count per script, used to warn about script drift.


cursors​

cursors: Record<string, number>

Defined in: types.ts:219

Next beat index per script, indexed into the script's raw beat array.


entries​

entries: TranscriptEntry[]

Defined in: types.ts:213


lastActivityAt​

lastActivityAt: number

Defined in: types.ts:259

Game time of the newest entry.


lastSeenAt​

lastSeenAt: number

Defined in: types.ts:256

Game time the chat was last marked seen at.


nextDueAt​

nextDueAt: number | null

Defined in: types.ts:232

Game time delivery is blocked until, or null when nothing is pending.

Remarks​

This single field replaces a queue of scheduled messages: everything due is derived from the cursor and the clock, so a save loaded much later simply delivers what became due while it was away.


nextKey​

nextKey: number

Defined in: types.ts:262

Counter behind TranscriptEntry.key.


participants​

participants: string[]

Defined in: types.ts:247

Current members, as contact ids. Empty for a direct chat.


pendingChoiceKey​

pendingChoiceKey: string | null

Defined in: types.ts:238

Choice id awaiting the player's reply, or null.


readOnly​

readOnly: boolean

Defined in: types.ts:250

Whether the player can never reply in this chat.


title?​

optional title: RichText

Defined in: types.ts:241

In-fiction title, once renamed.


typingUntil​

typingUntil: Record<string, number>

Defined in: types.ts:235

Game time each contact's typing indicator expires at.


unread​

unread: number

Defined in: types.ts:253

Number of entries the player has not seen.