Lifehacks #1 in @MenuBuilderBot
Lifehack #1: password protected bots
![](/file/42cbede29c1d00b9e554a.png)
We are starting to publish various use cases that can be constructed with the existing @MenuBuilderBot capabilities.
Русский перевод, который любезно предоставлен переводчиком Яндекса, здесь.
Password protected bot (part of the bot): user can use bot or visit some of the bot submenu(s) only if he knows and entered the correct password.
To create password protection you need:
- Text user variable (1$)
You can use any existing unneeded text variable if you already have some. - Button conditions (3$)
One-time purchase for the whole bot.
Steps to create password protected bot:
1. Purchase and create a text variable. Name it, for example, "user_pass".
You can use any existing unneeded text variable if you already have some.
2. Create two buttons.
2.1 One for menu entrance, for example: "Enter the world"
2.2 One to ask for password, for example: "Proof you have access"
![](/file/3eef8572f7e4248595ece.png)
3. Select "Enter the world" and go to it's properties
![](/file/0119c51b6b6e53de0050a.png)
4. Press "Assign condition"
You will not see this button if you did not purchase button conditions!
![](/file/5d5ccf4501ce85bb7e9dc.png)
5. Put there the following condition
{"%user_pass%" == "password"}
The %user_pass% should be replaced with your variable name if it differs.
The "password" should be replaced with your password.
![](/file/41fbf6602bd30bd2b66eb.png)
6. Put any message you want to show to user if he did not enter the password or his password is wrong.
Like this:
"Sorry, you cannot enter. Press "Proof you have access" and enter the correct password to access my world."
![](/file/bda4a24a540b4dfe2d79c.png)
7. Exit button settings
8. Now go to "Post Editor" and enter the "Proof you have access" buton
![](/file/fca14b6d3737f705a8143.png)
9. Press "+Add Variable input" and select "user_pass" variable (or other variable you used in previous steps) from the list
You will not see this button if you did not have variables!
![](/file/2145136acbbb3460394eb.png)
10. Enter the question like this:
"Please, enter the password:"
![](/file/5c65394ab9b647d939f02.png)
You've done. :)
![](/file/0746bcaad04414d5e47c6.png)
![](/file/4ad06516b11a9b7f94935.png)