Creating variables

How to create a variable name

A variable name must consist of Latin letters or numbers. Numbers mustn't be at the beginning of the variable name.

To make a variable from several words, you can write it as follows:

  1. userNewPhone
  2. user_new_phone

For convenience, you can shorten words in long variables, for example, usNph.

Common mistakes in naming a variable

last_request, this_user are default variables. Writing new values to the default variables can easily disrupt the entire work of the bot. You can work with them, but you cannot change User Input, Record, Fork using the components.

sum, text are actions and types. In this case, the data is often written incorrectly, because the bot perceives these values as an action with variables or a data type.

var 1 is a name with a space. The variable won't be recorded, and you won't be able to work with it in the future.

cyrillic — variables named in non-Latin letters, most often don't work.

Data types of variables

text — any text entered by the user. In the fork, you need a complete match with the entered text or the selected button.

email — email only, recognizes only in format ex@ex.ex.

href — links starting with the protocol (for example, https://vk.com instead of vk.com).

number — only numbers without spaces.

date — date only.

location — location (best used with buttons with hints — request a geolocation).

file — the file is sent to the server, then you can download it from the link.

contact — it is used to receive a contact from Telegram (buttons with hints, contact type).

regexp — regular expression.

voice — voice message.

To write variables, you need to use User input, Assign, Fork components.