When should I use curly braces and when not for variables?
If you are confused about when you should use curly braces for variables, read more...
Md Shahriyar Alam
2 years ago
There are multiple places we use variables, In Content, Embed, Pre Code and Post Code. But when should we use curly braces to make them work?
When to use?
If you are using variables in Content or Embed then you have to use curly braces to make them work. Otherwise they will be treated as normal texts
Example
py
Hello {user.mention}!When not to use?
If you are using any variables in the Pre Code or Post Code you don't have to use any curly braces at all. In fact using them will cause errors.
Example
py
add_roles(user, 3904234823402349234)Loading comments…
Need help?
Have a question, a suggestion, or stuck on something? Reach out — we're happy to help.