Options
All
  • Public
  • Public/Protected
  • All
Menu

The Key Value Store is perfect to store any type of data as JSON.

Index

Functions

get

  • get(botId: string, key: string, path?: undefined | string): Promise<any>
  • Returns the specified key as JSON object

    example

    bp.kvs.get('bot123', 'hello/whatsup')

    Parameters

    • botId: string
    • key: string
    • Optional path: undefined | string

    Returns Promise<any>

getConversationStorageKey

  • getConversationStorageKey(sessionId: string, variable: string): string
  • Parameters

    • sessionId: string
    • variable: string

    Returns string

getGlobalStorageKey

  • getGlobalStorageKey(variable: string): string

getStorageWithExpiry

  • getStorageWithExpiry(botId: string, key: string): any

getUserStorageKey

  • getUserStorageKey(userId: string, variable: string): string

removeStorageKeysStartingWith

  • removeStorageKeysStartingWith(key: any): Promise<void>

set

  • set(botId: string, key: string, value: any, path?: undefined | string): Promise<void>
  • Saves the specified key as JSON object

    example

    bp.kvs.set('bot123', 'hello/whatsup', { msg: 'i love you' })

    Parameters

    • botId: string
    • key: string
    • value: any
    • Optional path: undefined | string

    Returns Promise<void>

setStorageWithExpiry

  • setStorageWithExpiry(botId: string, key: string, value: any, expiryInMs?: undefined | string): any
  • Parameters

    • botId: string
    • key: string
    • value: any
    • Optional expiryInMs: undefined | string

    Returns any

Generated using TypeDoc