Skip to main content
Bots.LT provides a built-in Key-Value (KV) store with three scopes for String/JSON data, a Resource system for numeric data (like coins/points), and a wait state system for multi-step conversations. No external database is needed.

1. String & JSON Data (Properties)

This system is ideal for storing text, configurations, and complex JSON data. Data is stored and retrieved using three scope objects, each with the same set of methods.

Scopes


User Data Methods

The User object isolates data specifically for the individual interacting with your bot.

User.saveData

Saves a value for the current user. (Aliases: setProperty, setProp)
BLP Example

User.getData

Retrieves a stored value for the current user. Returns None if it does not exist. (Aliases: getProperty, getProp)
BLP Example

User.deleteData

Deletes a key from the user’s data. (Aliases: deleteProperty, deleteProp)
BLP Example

User.getDataFile

Exports a specific user value as a downloadable file.
BLP Example

User.getAllData

Gets all user keys matching a pattern across all users, returning a file.
BLP Example

User.getAllDataOfUser

Exports all data stored for a specific user.
BLP Example

Bot Data Methods

The Bot object stores global data that is shared across all users in the same bot.

Bot.saveData

Saves a value globally for the bot.
BLP Example

Bot.getData

Retrieves a stored value for the bot. Returns None if it does not exist.
BLP Example

Bot.deleteData

Deletes a key from the bot’s data.
BLP Example

Bot.getDataFile

Exports a specific bot value as a downloadable file.
BLP Example

Bot.getAllData

Gets all bot keys matching a pattern, returning a file.
BLP Example

Bot.getBotUsersFile

Exports the full list of users who have interacted with the bot.
BLP Example

Account Data Methods

The Account object stores data at the developer account level, making it accessible across all bots you own.

Account.saveData

Stores data at the account level, accessible across all bots.
BLP Example

Account.getData

Retrieves previously stored account data.
BLP Example

Account.deleteData

Deletes account data by name.
BLP Example

Account.getDataFile

Returns account data as a file that can be sent to users.
BLP Example

Account.getAllData

Retrieves all account data entries, optionally filtered by name pattern.
BLP Example

Account.deleteAllData

Deletes all account data, with optional exclusions.
BLP Example

Account.info

Returns basic account information for the developer.
BLP Example

2. Numeric Data (Resources)

Manage virtual balances, point systems, and leaderboards β€” without writing any database queries. This is the recommended way to handle numbers and math-based data.

Accessing Resources

Resource Methods

Once accessed, each resource object supports:
BLP Example
BLP Example (Leaderboard)
BLP Example (Shared Global Counter)
BLP Example (Account Resource)

3. Wait States (Conversational Flows)

Use wait states to build multi-step conversations β€” asking users for input one step at a time, like forms, quizzes, or registration wizards.

Bot.handleNextCommand

Routes the user’s next message to a specific command, regardless of what they type.
BLP Example (2-step registration)
BLP Example (Passing data between steps)