Skip to Content
🎉 Tickety now has applications. Read more →

If Statement Parser

The If Statement Parser allows you to create conditional responses based on comparisons between values. It evaluates an expression and returns one of two possible messages depending on whether the condition is true or false.

Usage

To use the parser, insert the following syntax in your text:

{if(expression):trueMessage|falseMessage}

Expression Operators

The following operators are available for creating expressions:

OperatorDescriptionExampleMeaning
==Equalitya==aChecks if two values are equal
!=Inequalitya!=bChecks if two values are not equal
>Greater than5>3Checks if first value is greater than second
<Less than4<8Checks if first value is less than second
>=Greater than or equal10>=10Checks if first value is greater than or equal to second
<=Less than or equal5<=6Checks if first value is less than or equal to second

Examples

  1. Simple comparison:
  • Input: {if(5>3):True|False}
  • Output: True
  1. Nested conditions:
  • Input: {if({args}==63):You guessed it!|Too {if({args}<63):low|high}, try again.}
  • With args=63: You guessed it!
  • With args=73: Too high, try again.
  • With args=14: Too low, try again.
  1. Using with placeholders:
  • Input: {if(contains(roleId):{member.roles}):Welcome admin!|Access denied.}
  • Output with admin role: Welcome admin!
  • Output without admin role: Access denied.

Notes

  • Expressions can use any valid placeholder values
  • Multiple conditions can be nested for complex logic
  • The true and false messages are required and must be separated by a pipe (|)
  • Whitespace around operators is ignored