Skip to main content
Bots.LT provides a robust Key-Value (KV) storage system and Wait State managers. You do not need an external database to build complex bots!

Data Storage (KV Store)

You can save and retrieve data across three different scopes: User, Bot, and Api.

Storage Methods

The following methods are available on all scopes:
  • saveData(key, value): Saves a value to the database. (Aliases: setProperty, setProp)
  • getData(key): Retrieves a value from the database. (Aliases: getProperty, getProp)
  • deleteData(key): Deletes a value from the database. (Aliases: deleteProperty, deleteProp)
BLP Example

Wait States (Conversational Flows)

Often, you need to ask a user a question and “wait” for their next message (e.g., asking for a name, email, or amount). You can handle this easily using Wait States.

Bot.handleNextCommand(command, **options)

This method tells the bot: “When this user sends their very next message, immediately route it to the specified command, regardless of what they typed.”

Basic Example

Imagine you have two commands: /start and /save_name. Command 1: /start
BLP Example
Command 2: /save_name
BLP Example

Passing Data Between Commands (Options)

You can forward temporary data to the next command by passing it as keyword arguments (**options). Command 1: /ask_age
BLP Example
Command 2: /save_age
BLP Example
Note: Wait states are extremely powerful for building multi-step forms, quizzes, and registration flows without needing complex database flags.