Commands to manage variables¶
You can use commands to quickly modify variables in your bot:
1. Assign or Change values (/varset
):¶
-
For private variables:
/varset var_name user_id_or_username data
Example:
/varset wallet @johndoe TXU22jY3F6av1Yuux2pch2wFp1sfErfWAx
-
For global variables:
/varset global_var_name data
Example:
/varset global_descuento 20
(sets it to 20)
2. Increment or Decrease values (/varinc
) (for numeric variables only):¶
-
For private variables:
/varinc var_name user_id_or_username data
Example:
/varinc balance @johndoe 5
(increments by 5) -
For global variables:
/varinc global_var_name data
Example:
/varinc global_descuento -10
(decreases by 10)
3. Get the current value of a variable (/varget
):¶
-
For private variables:
/varget var_name user_id_or_username
Example:
/varget balance @johndoe
-
For global variables:
/varget global_var_name
Example:
/varget global_descuento
4. Reset values (/varclear
, /varclearall
) (for private variables only):¶
-
/varclear var_name user_id_or_username
Resets a private variable to the default value for one user.
-
/varclearall var_name
Resets the private variable for all users.
5. Set the same value for all (/varsetall
) (for private variables only):¶
-
/varsetall var_name data
Example:
/varsetall balance 0