Skip to main content

Class: MemoryStore

Defined in: state/StateStore.ts:16

In-memory StateStore. Fine for a single process; lost on restart.

Implements

Constructors

Constructor

new MemoryStore(): MemoryStore

Returns

MemoryStore

Methods

delete()

delete(chatId): void

Defined in: state/StateStore.ts:27

Removes all state for a chat.

Parameters

chatId

string

Returns

void

Implementation of

StateStore.delete


get()

get(chatId): Record<string, unknown>

Defined in: state/StateStore.ts:19

Returns the full state object for a chat (empty object if none).

Parameters

chatId

string

Returns

Record<string, unknown>

Implementation of

StateStore.get


set()

set(chatId, state): void

Defined in: state/StateStore.ts:23

Replaces the full state object for a chat.

Parameters

chatId

string

state

Record<string, unknown>

Returns

void

Implementation of

StateStore.set