Lists

Use Lists to store large amounts of data. List is a quick way to get and search data. Also list is preferred way for organize statistics.

List - it is a collection of properties or users.

Examples:

  • history (orders history, transactions, payments history, locations history, etc)

  • large price lists

  • table of cities with population

  • results for Inline Bot

  • referrals list

List initialization

Before using the list (new or existing), you need to initialize it.

List can be global for Bot:

let list = new List({ name: "MyList" })

Bot.inspect(list.exist) // false for new List, true for already exist list

or can be personal for user:

After it you can perform another list methods

Create new list

Remove list

Recount list

Recalculate all statistical data in list.

Can spent 5-30 seconds and more for big list. So you need perform this task on background once in week/day or hour.

you can get delay time in ms:

recount lag:

Calculate the amount of all props and users

Need recount before

Properties management

Add bot property to bot list

Bot property can be added to List for bot

Add user property to user list

User property can be added to List for user

Add user property to bot list

User property can be added to List for bot

Reject property

Reject property from list without destroying by prop name

Remove property

Reject property from list and destroy it by prop name

Reject all properties (and all users)

Reject all properties from list

Remove all properties (and reject all users)

Remove all properties from list

Users management

Add user

Reject user

Reject user from list

Reject all users

Reject all users from list

Getting data

Getting props from list

Getting users from list

Paginating

We have pages for data. Data is given page by page from the first page.

One page have 100 items by default.

User searching

Getting user by id from list

Checking the user's existence in the list

Statistics

Is available for integer and float props

Need recount before

Last updated

Was this helpful?