🎉 Tickety V3 has now been released! Read more →
PlaceholdersParsers

Includes Parser

The Includes Parser checks whether a given payload contains a specified value and returns the result as a string.

Usage

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

{includes(<search>):<payload>}

Aliases: in, contains, contain — all behave the same way.

Behaviour

  • If the payload is a JSON array (e.g. ["a","b"]), the parser checks whether any element strictly matches the search value after coercing array elements to strings. This means numeric array elements like 63 will match the search value "63".
  • If the payload is not valid JSON, the parser falls back to a substring check using String.prototype.includes on the payload string.

Examples

1. Array membership (JSON array payload)

  • Input: {includes(apple):["apple","banana"]}
  • Output: true

2. String contains (plain string payload)

  • Input: {includes(world):Hello world}
  • Output: true

3. Numeric match with type coercion

  • Input: {includes(63):[63,72,81]}
  • Output: true

4. Using placeholders

  • Input: {includes(123):{member.roles}}
  • Assuming member.roles is "[\"123\",\"456\"]" (a JSON array string)
  • Output: true

Notes

  • When given a JSON array payload, elements are compared by converting each element to a string and doing a strict string equality check against the search value.
  • When the payload is not a JSON array, a substring includes check is performed on the payload string.
  • Whitespace around the search parameter is trimmed before comparison.

On this page