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
Parameters
Section titled “Parameters”current
Section titled “current”string = Schema.String
Application build fingerprint. Empty means “do not check”.
component
Section titled “component”string = Schema.String
Registered component key, resolved by the platform integration.
createdAt
Section titled “createdAt”number = Schema.Finite
ephemeral
Section titled “ephemeral”boolean = Schema.Boolean
expiresAt?
Section titled “expiresAt?”number = ...
string = Schema.String
lastInteractionId?
Section titled “lastInteractionId?”string = ...
message?
Section titled “message?”{ channelId?: string; guildId?: string; id: string; } = ...
message.channelId?
Section titled “message.channelId?”string = ...
message.guildId?
Section titled “message.guildId?”string = ...
message.id
Section titled “message.id”string = Schema.String
unknown = Schema.Unknown
state?
Section titled “state?”{[key: string]: unknown; } = ...
status
Section titled “status”"closed" | "pending" | "active" = ...
updatedAt
Section titled “updatedAt”number = Schema.Finite
version
Section titled “version”number = Schema.Int
The state version the message on the platform shows. Bumped per interaction.
mutation
Section titled “mutation”{ _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; }
Returns
Section titled “Returns”{ _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; }