SmartbotPro
  • Smartbot Pro – messenger marketing tool
  • Most important
  • Mini-course
    • Registration and personal account
    • Initial scripting tools
    • Creating the first script
    • Users and collection of information
    • Applications, variables and managers
    • Data validation
    • Collection of applications for a webinar within Telegram
    • Testing unpublished scripts
    • Newsletters
    • Template "Test with a set of points"
    • Statistics
    • Interface hacks
  • Beginning of work
    • Registration in the service
    • More about scripts
    • How to add messenger
      • Adding Telegram
        • Adding a bot to a group chat in Telegram
      • Adding ВК
      • Adding Viber
      • Connecting a channel to a script
      • Linking a social network account
  • Scripts
    • Basics
      • Create a script
      • Script templates
      • Editor interface
      • Publishing a script
      • Script testing
      • How the script is chosen
    • Script events
      • Message from user
      • No appropriate script
      • First message
      • VK Events
      • Webhook
    • Actions
      • Send a message
        • Buttons
      • Process message
      • Extract data
      • Change context
      • Write to statistics
      • Send Notification
      • Switching to another script
      • Working with the user
      • Set variable
      • Scheduled transitions
      • Run SmartQuery
    • Conditions
      • Condition
      • Condition with options
      • Conditions of VKontakte
    • Variables
      • Special Variables
      • User variables
      • Global variables
      • Variable %ref%
    • Acceptance of payment
    • Telegram bot menu
    • Integrations
      • Google-таблицы
      • http request
      • amoCRM
      • Get Course
      • Yukassa for receiving payments
    • Reactions
  • Newsletters
  • Settings
    • Projects
    • Cabinets
  • Information sections
    • Statistics
    • Users
  • SmartQuery
    • Introduction
    • Language syntax
    • Function Reference
  • The documents
    • Privacy Policy
    • Terms of service
    • Subscription and rates
Powered by GitBook
On this page
  • Special Variables
  • User variables
  • Types of variables
  1. Scripts

Variables

In this section, we will look at what variables are in Smartbot Pro.

PreviousConditions of VKontakteNextSpecial Variables

Last updated 2 years ago

Variables allow you to save messages and personal user parameters (for example, name, id, points scored, etc.), set conditions (current date and time, type of channel in which the message was received), perform mathematical operations and embed dynamic text in messages .

Variables are keys in the format %variable_name% that will be replaced by the bot with variable values ​​in the message text or condition.

For example, if you write %name% in the text of the message, the bot will replace this variable with the username. There are two main types of variables: special and user defined.

Special Variables

They are already pre-installed by the developer in the bot, they cannot be deleted or changed. Special variables perform complex functions, such as returning the user's id, storing the last message received, keeping track of local time, and so on.

User variables

You can create and modify them yourself. Just click the "+Add variable" button.

Let's say it can be a bonus counter %Points% or a variable %already participated%, the initial value of which is "no", but after a certain action it will change to "yes" and will not allow the user to go through the activity again.

Custom variables can be local (that is, the value is individual for each person) and global (the value is common to all users). Types of variables

Types of variables

Attachment - you can save a file into this variable: a picture, a document, an audio recording, etc.

Line - a word, a phrase, an individual code. For example: %status% = "client"

A number is a number that can be used for calculations. For example, a replenishable bonus counter; personal balance in the game; virtual currency.

A flag is an analogue of a "tick" with built-in "yes" and "no" values. Useful if you are planning a one-time activity.

An array is a collection of data (numbers or strings).

It has the format: ["element 1", "element 2", "element 3", "element 4"] - square brackets, within which each element is written in quotation marks and separated by commas.

The array can store promotional codes for issuance, names of participants in a certain game, and many other useful things :)

A dictionary is a collection of key-value data pairs.

Dictionary format: {"key": "value", "key 2": "value 2"} - curly braces, double quotes for keys and values ​​(except for values ​​expressed as numbers) and separated by commas.

Thus, you can add to the array: "car, plane, ship"; and in the dictionary: “3 cars, 4 planes, 2 ships” and change their number right along the chain.

If you write it in the correct format, it will look like this: ["car", "aircraft", "ship"] into an array. {"car": 3, "aircraft": 4, "ship": 2} - to the dictionary

To work with arrays and dictionaries, use - commands built into the bot, similar to a programming language.

Variables allow you to significantly expand the functionality and implement almost any logic of the bot's actions

💪
smart query
Русский
More about working with dictionaries
And about working with arrays
Так выглядит раздел переменных в Smartbot Pro
Here is a far from complete list of special variables in Smartbot Pro that you can use