Conditions in @MenuBuilderBot

Conditions in @MenuBuilderBot

MegaHubTelegram

Conditions in @MenuBuilderBot give administrators the ability to determine the behavior of their bots depending on the state of individual variables and other parameters. Conditions can be added to Buttons, Actions, as well as used during Mailing.


📜 The translation of this materials into your native language can be automatically done using the Google translator. Follow the link and select the desired language in the title:
https://translate.googleusercontent.com/translate_c?depth=1&sl=en&tl=es&u=https://telegra.ph/Conditions-in-MenuBuilderBot-EN-05-14


⬛ What are Conditions.


Conditions are Expressions (Guide on Expressions here) with additional characters and logical operators. You can use the full power of Expressions in Conditions.

Every condition must return TRUE or FALSE as the result.


Condition Syntax

The syntax of the Conditions is inherited from Expressions. For this reason, the Conditions should be taken in curly brackets "{}", inside, besides the Operators peculiar only to the Conditions, you can use expressions in parentheses, calculations and macros.

In general, the Conditions template may look something like this:

{(...) and (...) or (...) not (...)}


Comparison operators

Using these operators, two parts of an expression are compared.

  1. >,> = (greater than, greater than or equal to)
  2. <, <= (less, less or equal)
  3. == (equal) Notice! Not one "=" sign!
  4. != (not equal)


Logical operators

Logical operators combine the results of several logical expressions. Each logical expression must return TRUE / FALSE. It is strongly recommended that you use parentheses "()" to define each logical expression.

  1. and (logical "and")
  2. or (logical "or")
  3. not (logical "not")


Examples:

TRUE if the user has money on his balance and one or more referrals.

TRUE if the user has money on the balance or funds on his USD variable.

TRUE if the user’s Balance is greater than the value of the VIP and he is not banned or he is a VIP user.

TRUE if the user's balance is not greater than zero (less than or equal to zero). It is mainly used in complex expressions.


More complex options are also possible {(xxx) and ((yyy) or (zzz))}:

{(%balance%> 100) and ((%refcount%> 10) or (%invest%> 500))}

In the example above, two conditions must be met - the first is exact and either of the last two. Thus, the user must have a %balance% of more than 100 and either more than 10 on %refcount% or more than 500 on %invest%.


The use of Conditions

When adding a Condition to a button or Action, it sometimes becomes difficult to determine how and at what particular moment the added Condition will trigger.

It is important to remember that in all cases the Condition added by you describes the normal state of the system, the state in which the system usually works. This way, while the system is within the boundaries described in the condition - no additional actions will be taken by the Condition itself. As soon as, during the next check, the Condition will turn out to be “False” (or 0 - Zero) - the restriction mechanism in the Condition will trigger and the function protected by this condition will be interrupted. The same applies to the Actions of Condition - in this case, FAILURE in fulfilling its Conditions will interrupt the further chain of Actions.


Thus, in case of difficulties with the Conditions, always think as follows: "Until - (here is your condition) - do nothing, otherwise interrupt."


⬛ Conditions in buttons.


Conditions, when added to a button, determine whether a particular user has the right to access a specific button.


Before you can use the Conditions in the buttons of your bot, you need to activate it:

To do this, go to your bot:

☞ 🔐Admin | 🧩Extensions | 📂Buttons

🔌 (Plugin) Conditions


Go to the button settings:

Click "Assign Condition":


And... Assign Condition:


After sending the Condition itself to the bot, you will be asked to add a message that will be displayed to the user if the condition is not met (error message). This action is optional.

3 options at the stage of adding an error message.

Three options: Add a new message, Leave as is - if the message was added earlier or simply Leave it empty (the "Set Empty" button will clear the message text if it was added earlier). After selecting one of the options, the Condition for the button will be created.


Thus, the created button will work for the user only if its balance is greater than 100. Otherwise, the button will display an error message if it was added by the administrator.


⬛ Conditions for Mailing.


Conditions can be used when sending messages (mailing) to users of your bot. Using the Conditions, we can determine which users will receive the sent message.


Before you can use the Conditions in the mailing, you need to activate it:

To do this, go to your bot:

☞ 🔐Admin | 🧩Extensions | 📂Optimization

Conditions for Mailing


The button will appear only after purchasing the function.


You can set any acceptable conditions.

For example:

The message will be sent only to users who have something on their balance (who has a balance greater than zero).



⬛ Additional Information.


Conditions can also be used in Actions.

For more information on the types of Actions and the use of Conditions in them, read the separate "Guide to Actions".


https://telegra.ph/Menu-Builder---All-Help-Materials-02-22

Report Page