Skip to content

advanceSession

advanceSession(current, mutation): { _tag: "closed"; } | { _tag: "ok"; session: { build: string; component: string; createdAt: number; ephemeral: boolean; expiresAt?: number; id: string; lastInteractionId?: string; message?: { channelId?: string; guildId?: string; id: string; }; props: unknown; state?: {[key: string]: unknown; }; status: "closed" | "pending" | "active"; updatedAt: number; version: number; }; } | { _tag: "expired"; expiresAt: number; }

Defined in: packages/core/src/session/advance.ts:79

string = Schema.String

Application build fingerprint. Empty means “do not check”.

string = Schema.String

Registered component key, resolved by the platform integration.

number = Schema.Finite

boolean = Schema.Boolean

number = ...

string = Schema.String

string = ...

{ channelId?: string; guildId?: string; id: string; } = ...

string = ...

string = ...

string = Schema.String

unknown = Schema.Unknown

{[key: string]: unknown; } = ...

"closed" | "pending" | "active" = ...

number = Schema.Finite

number = Schema.Int

The state version the message on the platform shows. Bumped per interaction.

{ _tag: "close"; now: number; } | { _tag: "update"; now: number; update: (current) => object; } | { _tag: "setState"; now: number; state: State; } | { _tag: "attachMessage"; message: { channelId?: string; guildId?: string; id: string; }; now: number; }

{ _tag: "closed"; } | { _tag: "ok"; session: { build: string; component: string; createdAt: number; ephemeral: boolean; expiresAt?: number; id: string; lastInteractionId?: string; message?: { channelId?: string; guildId?: string; id: string; }; props: unknown; state?: {[key: string]: unknown; }; status: "closed" | "pending" | "active"; updatedAt: number; version: number; }; } | { _tag: "expired"; expiresAt: number; }