---
url: >-
  https://docs.juniper.bot/en/message-templates/types/custom-commands/arguments.md
description: Arguments data type used in JuniperBot Custom Commands.
---

[Number]: /en/message-templates/types/index#literals

[String]: /en/message-templates/types/index#literals

[Boolean]: /en/message-templates/types/index#literals

[List]: /en/message-templates/types/index#lists

[Map]: /en/message-templates/types/index#maps

[DateTime]: /en/message-templates/types/index#datetime

[TwitchChannel]: /en/message-templates/types/subscriptions/twitch#twitch-channel

[TwitchStream]: /en/message-templates/types/subscriptions/twitch#twitch-stream

[TwitchGame]: /en/message-templates/types/subscriptions/twitch#twitch-game

[YouTubeChannel]: /en/message-templates/types/subscriptions/youtube#youtube-channel

[YouTubeVideo]: /en/message-templates/types/subscriptions/youtube#youtube-video

[VkWallPost]: /en/message-templates/types/subscriptions/vk#vkwallpost

[Rank]: /en/message-templates/types/discord/rank

[Guild]: /en/message-templates/types/discord/guild

[Member]: /en/message-templates/types/discord/member

[Role]: /en/message-templates/types/discord/role

[Message]: /en/message-templates/types/discord/message

[Attachment]: /en/message-templates/types/discord/attachment

[Embed]: /en/message-templates/types/discord/embed

[Activity]: /en/message-templates/types/discord/activity

[MemberVoiceState]: /en/message-templates/types/discord/member-voice-state

[MemberPrimaryGuild]: /en/message-templates/types/discord/member-primary-guild

[MenuBuilder]: /en/message-templates/types/discord/menu-builder

[UserFlag]: /en/message-templates/types/discord/user-flag

[Permission]: /en/message-templates/types/discord/permission

[Category]: /en/message-templates/types/discord/category

[TextChannel]: /en/message-templates/types/discord/text-channel

[VoiceChannel]: /en/message-templates/types/discord/voice-channel

[NewsChannel]: /en/message-templates/types/discord/news-channel

[StageChannel]: /en/message-templates/types/discord/stage-channel

[ForumChannel]: /en/message-templates/types/discord/forum-channel

[MediaChannel]: /en/message-templates/types/discord/media-channel

[ThreadChannel]: /en/message-templates/types/discord/thread-channel

[Page]: /en/message-templates/types/storage/page

[GuildIndex]: /en/message-templates/types/storage/guild-index

[GuildIndexEntry]: /en/message-templates/types/storage/guild-index-entry

[GuildIndexes]: /en/message-templates/types/storage/guild-indexes

[MemberAttribute]: /en/message-templates/types/storage/member-attribute

[MemberAttributes]: /en/message-templates/types/storage/member-attributes

[Arguments]: /en/message-templates/types/custom-commands/arguments

[Parameters]: /en/message-templates/types/custom-commands/parameters

[Component]: /en/message-templates/types/custom-commands/component

[Modal]: /en/message-templates/types/custom-commands/modal

# Arguments

This data type describes the [custom command](../../../cmd/custom/index) arguments and options.

## Properties { #properties }

| Property       | Type             | Description                                                                                                                                                                                                                                                                                                             |
|:---------------|:-----------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value`        | \[String]         | Original message string of command invocation.                                                                                                                                                                                                                                                                          |
| `args`         | \[List]<\[String]> | List of the arguments extracted from the string and split by whitespace.                                                                                                                                                                                                                                                |
| `targetMember` | \[Member]         | If invoked by Text Command — first mentioned member or member with the id, specified as first argument;If invoked by Member Context Menu — menu owner;If invoked by Message Context Menu — message author;If invoked by Slash Command — any member specified as parameter. |

## Methods { #methods }

### `get(Position)` { #method-get .template-method }

::: tabs

\== Description | mdi-text

Returns argument by its position.

**Returns:** \[String]

\== Parameters | mdi-code-parentheses

| Parameter  | Type     | Description                     |
|:-----------|:---------|:--------------------------------|
| `Position` | \[Number] | Argument number (starts from 1) |

\== Example | mdi-code-block-braces

```template
{{ arguments.get(1) }}
```

:::

### `after(Position)` { #method-after .template-method }

::: tabs

\== Description | mdi-text

Returns all the arguments after position specified.

**Returns:** \[String]

\== Parameters | mdi-code-parentheses

| Parameter  | Type     | Description                     |
|:-----------|:---------|:--------------------------------|
| `Position` | \[Number] | Argument number (starts from 1) |

\== Example | mdi-code-block-braces

```template
{{ arguments.after(2) }}
```

:::

### `before(Position)` { #method-before .template-method }

::: tabs

\== Description | mdi-text

Returns all the arguments before position specified.

**Returns:** \[String]

\== Parameters | mdi-code-parentheses

| Parameter  | Type     | Description                     |
|:-----------|:---------|:--------------------------------|
| `Position` | \[Number] | Argument number (starts from 1) |

\== Example | mdi-code-block-braces

```template
{{ arguments.before(3) }}
```

:::

### `range(Start, End)` { #method-range .template-method }

::: tabs

\== Description | mdi-text

Returns arguments from specified range.

**Returns:** \[String]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description   |
|:----------|:---------|:--------------|
| `Start`   | \[Number] | Range start \* |
| `End`     | \[Number] | Range end \*   |

\* Argument positions starts from 1.

\== Example | mdi-code-block-braces

```template
{{ arguments.range(1, 5) }}
```

:::

### `getOption(Name)` { #method-getoption .template-method }

::: tabs

\== Description | mdi-text

Returns Slash Command option by name.

**Returns:** \[String], \[Number], \[Boolean], \[Member], \[Role], \[Attachment], \[TextChannel], \[NewsChannel], \[VoiceChannel], \[StageChannel], \[ForumChannel], \[MediaChannel], \[ThreadChannel], \[Category]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description |
|:----------|:---------|:------------|
| `Name`    | \[String] | Option name |

\== Example | mdi-code-block-braces

```template
{{ arguments.getOption('optionName') }}
```

:::

### `getOptionsByType(Type)` { #method-getoptionsbytype .template-method }

::: tabs

\== Description | mdi-text

Returns Slash Command options list by type.

**Returns:** \[List] of \[String], \[Number], \[Boolean], \[Member], \[Role], \[Attachment], \[TextChannel], \[NewsChannel], \[VoiceChannel], \[StageChannel], \[ForumChannel], \[MediaChannel], \[ThreadChannel], \[Category]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description                                                                                                       |
|:----------|:---------|:------------------------------------------------------------------------------------------------------------------|
| `Type`    | \[String] | Option type (`STRING`, `INTEGER`, `DECIMAL`, `BOOLEAN`, `MEMBER`, `ROLE`, `CHANNEL`, `MENTIONABLE`, `ATTACHMENT`) |

\== Example | mdi-code-block-braces

```template
{{ arguments.getOptionsByType('MEMBER') }}
```

:::
