Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 95 additions & 1 deletion docs/chatbot/commands/custom/examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,99 @@
# Examples

Commands can be created in either the dashboard or in chat.
These examples create custom commands directly in chat, but
you can just aswell create these commands by pasting them
into your dashboard.
Please refer to [Custom Commands](index.md)

### The simplest command

The simplest type of command just responds with text

#### Creating the command

```
!command add test This is a test command
```

#### Example input

```
!test
```

#### Example output

```
This is a test command
```

### Accepting arguments in a command
Arguments can be used with `${}` and the number of the passed argument

```
!command add greet Welcome to the stream ${1}!
```

#### Example input

```
!greet styler
```

#### Example output

```
Welcome to the stream styler!
```

### Accepting multiple arguments in a command
Arguments can be used with `${}` and the number of the passed argument.
If you pass the wrong number of arguments, the command won't run.

```
tbd
!command add greet Welcome to the stream ${1} and ${2}!
```

#### Example input

```
!greet styler styler2
```

#### Example output

```
Welcome to the stream styler and styler2!
```

### Using Variables

Chat commands support variables in a dynamic way. Variables are placeholders that can be used in chat commands to represent a specific value or piece of information. When a command is triggered, these variables are replaced with the actual values they represent. See [Variables](../../Variables)

```
!command add shoutout Check out ${1}, they are playing ${game ${1}} at https://twitch.tv/${channel ${1}}
```

#### Example input

```
!shoutout styler
```

#### Example output

```
Check out styler, they are playing Minecraft at https://twitch.tv/styler
```

### Setting permission level

You may may want to restrict who can use what command:

```
!command options shoutout -level 500
```
This only allows users with access level `moderator` or higher to use the command.
For a list of all available access levels see [!level](../default/level)

67 changes: 66 additions & 1 deletion docs/chatbot/commands/custom/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
---
id: custom commands
description: Learn how to create Custom Commands
tags:
- chatbot
- custom commands
keywords:
- streamelements
- chatbot
- commands
- custom commands
- add command
- create command
- remove command
- delete command
- edit command
---
# Custom Commands

In addition to the default commands, you can also create your own custom commands. Custom commands allow you to create commands that are tailored to your channel and your community. You can use custom commands to create unique interactions and functionalities that are not possible with the default commands.

## Creating a Custom Command
## Managing Custom Commands

There are 2 ways to manage a custom commands:
1. Through the creator dashboard
1. Directly in chat with the [!command](../default/command.md) command

### Using the Dashboard to manage custom commands

See [Creating a command](../../gettingstarted/customcommands/creating.md) in `Getting Started`

### Using chat to manage Custom Commands
#### Creating a Custom Command in chat

The general Syntax is the following:
```
!command add <command name> <response>
```

#### Modifying a Custom Command in chat

```
!command edit <command name> <response>
```

#### Deleting a Custom Command in chat

```
!command remove <command name>
```

#### Displaying the commands text in chat

```
!command show <command name>
```

##### Example Output:

```
@Styler, command test: ${channel} This is a test command. ${settitle ${1:}}
```

#### Changing the options / permissions / cooldowns of a command

```
!command options <command name> <-option> <value>
```

For specifics read the documentation for the [!command](../default/command.md) command