---
title: "{if:…}"
description: Say one thing or another depending on a comparison.
---

```text
{if:CONDITION|text if true|text if false}
{if:CONDITION|text if true}
```

**Platforms:** Twitch and Kick.

The condition is `A op B` where `op` is one of `==` `!=` `>` `<` `>=`
`<=` `contains`, or just a value on its own (true when it's not empty
and not `0`/`false`). Both sides are trimmed; if they're both numbers they
compare as numbers, otherwise as text, ignoring case.

## Examples

```text
!vip     →  {if:{arg:1}==secret|Welcome to the club, {user} 🥂|Nope.}
!tall    →  {if:{arg:1}>=180|{arg:1}cm - tall!|{arg:1}cm - average height enjoyer}
!live    →  {if:{uptime}==offline|{channel} is offline right now|{channel} has been live for {uptime}}
!echo    →  {if:{args}|{user} said: {args}|Say something, {user}!}
!mood    →  {if:{lower:{args}} contains sad|Sending hugs, {user} 💜|Glad to hear it, {user}!}
```

## Nesting

Both branches are ordinary template text, so they can hold more
variables - including another `{if:}`:

```text
!vote  →  {if:{arg:1}==yes|YES ✅|{if:{arg:1}==no|NO ❌|Vote yes or no}}
```

## Notes

- Everything inside gets evaluated first, then the condition is checked.
  A `{count}` in the false branch still bumps the counter; an `{ai:}`
  there still costs a call. Put expensive variables where they'll be used.
- Viewer text in a condition is compared as text, never parsed - a viewer
  can't type `|` or `==` to reach the other branch.
- The third `|` onward is all "false text", so `{if:x==x|a|b|c}` returns
  `b|c` when false.
