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 dataExample:
/varset wallet @johndoe TXU22jY3F6av1Yuux2pch2wFp1sfErfWAx -
For global variables:
/varset global_var_name dataExample:
/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 dataExample:
/varinc balance @johndoe 5(increments by 5) -
For global variables:
/varinc global_var_name dataExample:
/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_usernameExample:
/varget balance @johndoe -
For global variables:
/varget global_var_nameExample:
/varget global_descuento
4. Reset values (/varclear, /varclearall) (for private variables only):¶
-
/varclear var_name user_id_or_usernameResets a private variable to the default value for one user.
-
/varclearall var_nameResets the private variable for all users.
5. Set the same value for all (/varsetall) (for private variables only):¶
-
/varsetall var_name dataExample:
/varsetall balance 0