No JSDoc comment in source yet.
API
@Component()
export class MessagingConversationsRepo implements MessagingConversations {
@Use() private readonly db!: Db;
get(channel: string, accountId: string, chatId: string): Record<string, unknown> | null;
list(channel: string, accountId: string): { chatId: string; state: Record<string, unknown> }[];
put(channel: string, accountId: string, chatId: string, state: Record<string, unknown>): void;
}Dependencies & Wiring
Extracted from class decoratorsMethods (3)
get
get(channel: string, accountId: string, chatId: string): Record<string, unknown> | nullOne chat's stored state, or null when none is stored (or it does not parse).
@paramchannel
string@paramaccountId
string@paramchatId
string@returns
Record<string, unknown> | nulllist
list(channel: string, accountId: string): { chatId: string; state: Record<string, unknown> }[]Every stored chat of one bot, skipping documents that do not parse.
@paramchannel
string@paramaccountId
string@returns
{ chatId: string; state: Record<string, unknown> }[]put
put(channel: string, accountId: string, chatId: string, state: Record<string, unknown>): voidCreates or replaces one chat's state — and does nothing for a bot no binding references. The lifetime rule is enforced at the write as well as at the delete: a send still in flight when the last binding went would otherwise write its bookkeeping back after the delete, and the bot's next binding would inherit it.
@paramchannel
string@paramaccountId
string@paramchatId
string@paramstate
Record<string, unknown>@returns
void