# buildSlashRoute

`function` in `seedcord` · v0.11.0

<https://docs.seedcord.org/packages/seedcord/0.11.0/functions/build-slash-route>

From provided positional arguments. Either provide the route to either [`SlashRoute`](/packages/seedcord/0.11.0/functions/slash-route) or [`AutocompleteRoute`](/packages/seedcord/0.11.0/functions/autocomplete-route) manually, or use this utility to build it.

## Signature 1

```ts
buildSlashRoute<Cmmd, Subc, Grp>(
    command: Cmmd,
    subcommand?: Subc,
    group?: Grp
): CommandRouteString<Cmmd, Subc, Grp>
```

From provided positional arguments. Either provide the route to either [`SlashRoute`](/packages/seedcord/0.11.0/functions/slash-route) or [`AutocompleteRoute`](/packages/seedcord/0.11.0/functions/autocomplete-route) manually, or use this utility to build it.

Parameters.

- `command` `Cmmd` — Main command name
- `subcommand?` `Subc` — Optional subcommand name
- `group?` `Grp` — Optional group name (will be ignored if subcommand is not provided with it)

Returns `CommandRouteString<Cmmd, Subc, Grp>`.

## Signature 2

```ts
buildSlashRoute(
    interaction: ChatInputCommandInteraction | AutocompleteInteraction
): string
```

From a Discord interaction. The InteractionController uses this internally to build the route string to then route the correct handler.

Parameters.

- `interaction` `ChatInputCommandInteraction | AutocompleteInteraction`

Returns `string`.
