botas-core
    Preparing search index...

    Class FileStorage

    File-based storage implementation for simple persistence in single-instance deployments.

    Stores each key as a separate JSON file in the configured directory. Not suitable for multi-instance deployments — no locking or concurrency protection.

    // Default directory: './bot-state'
    const storage = new FileStorage()

    // Custom directory
    const storage = new FileStorage('./data/state')
    bot.useState(storage)

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Read items from file storage.

      Parameters

      • keys: string[]

        Keys to read.

      Returns Promise<Record<string, unknown>>

      Dictionary of key-value pairs that exist in storage.