Skip to main content
Version: Next

AiContext

AiContext

Represents the context in which an AI command is executed. This includes the parameters passed to the command, the message that triggered it, and the CommandKit instance associated with the command.

Signature
class AiContext<T extends Record<string, unknown> = Record<string, unknown>> {
public params!: T;
public message!: Message;
public client!: Client;
public commandkit!: CommandKit;
public store = new Map<string, any>();
constructor(options: AiContextOptions<T>)
setParams(params: T) => void;
}

params

property
T

The parameters passed to the AI command.

message

property
Message

The message that triggered the AI command.

client

property
Client

The client instance associated with the AI command.

commandkit

property

The CommandKit instance associated with the AI command.

store

property

A key-value store to hold additional data.

constructor

method
(options: AiContextOptions<T>) => AiContext

Creates a new instance of AiContext.

setParams

method
(params: T) => void

Sets the parameters for the AI context.