# Join Parser (/placeholders/parsers/join)



## Usage [#usage]

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

`{join(parameters):variable}`

### Parameters [#parameters]

Parameters are optional and can be combined using the pipe (`|`) separator:

* **Formatter**: `roles`, `channels`, or `mentions` - Formats Discord IDs into proper mentions
* **Custom Separator**: `sep=<separator>` - Sets a custom separator (default is ", ")

You can use both parameters together: `{join(mentions|sep= - ):variable}`

## Examples [#examples]

### 1. Basic joining [#1-basic-joining]

* Input: `{join:{cool.variable}}`
* Assuming `cool.variable` is `["apple", "banana", "orange"]`
* Output: `apple, banana, orange`

### 2. With Discord mention formatting [#2-with-discord-mention-formatting]

* Input: `{join(mentions):{ticket.users}}`
* Assuming `ticket.users` is `["123456789012345678", "987654321098765432"]`
* Output: `<@123456789012345678>, <@987654321098765432>`

### 3. Formatting roles [#3-formatting-roles]

* Input: `{join(roles):{member.roles}}`
* Assuming `member.roles` is `["123456789012345678", "987654321098765432"]`
* Output: `<@&123456789012345678>, <@&987654321098765432>`

### 4. Formatting channels [#4-formatting-channels]

* Input: `{join(channels):{guild.channels}}`
* Assuming `guild.channels` is `["123456789012345678", "987654321098765432"]`
* Output: `<#123456789012345678>, <#987654321098765432>`

### 5. Custom separator [#5-custom-separator]

* Input: `{join(sep= | ):{cool.variable}}`
* Assuming `cool.variable` is `["apple", "banana", "orange"]`
* Output: `apple | banana | orange`

### 6. Combining formatter and custom separator [#6-combining-formatter-and-custom-separator]

* Input: `{join(mentions|sep= - ):{ticket.users}}`
* Assuming `ticket.users` is `["123456789012345678", "987654321098765432"]`
* Output: `<@123456789012345678> - <@987654321098765432>`

## Notes [#notes]

* The parser accepts both JSON arrays and comma-separated strings as input
* If a single value is provided, it will be converted to a string
* The default separator is `", "` (comma followed by space)
* When using formatters, only valid Discord IDs (17-19 digits) will be formatted; other values are returned unchanged
* Multiple parameters can be combined using the pipe (`|`) separator
* Available formatters: `roles`, `channels`, `mentions`
* Custom separators can include spaces and special characters
