Skip to content

Commit 47ff7ff

Browse files
committed
docs: Add new variables for dynamic chat messages & commands
1 parent 7687cf6 commit 47ff7ff

11 files changed

Lines changed: 479 additions & 115 deletions

File tree

docs/chatbot/variables/game.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
---
22
id: game
3-
sidebar_label: $(game)
3+
sidebar_label: "$(game)"
4+
description: "Learn how to use the $(game) variable to display the current game being played on a Twitch channel."
5+
tags:
6+
- variables
7+
- game
8+
- twitch
9+
keywords:
10+
- StreamElements
11+
- chatbot
12+
- game variable
13+
- Twitch game
14+
- stream information
415
---
516

6-
# Game Variable
17+
# $(game) Variable
718

8-
### Description
19+
## Overview
920

10-
The `$(game)` variable displays the current game being played on a Twitch channel.
21+
The `$(game)` variable is a powerful tool that allows you to display the current game being played on a Twitch channel. This variable is particularly useful for creating dynamic commands or messages that reference the streamer's current activity.
1122

12-
### Usage
23+
## Usage
24+
25+
To use the `$(game)` variable, simply include it in your command or message:
1326

1427
```
1528
$(game)
1629
```
1730

18-
You can also specify a username to check the game of a different channel:
31+
You can also check the game of a specific channel by providing a username:
1932

2033
```
2134
$(game *username*)
2235
```
2336

24-
### Examples
37+
## Examples
2538

26-
1. Check the current game on your channel:
39+
1. Display the current game on your channel:
2740
```
2841
Current game: $(game)
2942
```
@@ -35,12 +48,22 @@ $(game *username*)
3548
```
3649
Output: `shroud is playing: Counter-Strike: Global Offensive`
3750

38-
### Parameters
51+
## Parameters
3952

4053
- `username` (optional): The Twitch username of the channel you want to check. If not provided, the command will display the game of the current channel.
4154

42-
### Related Commands/Variables
55+
## Related Commands
4356

4457
- [`$(title)`](title.md): Displays the current stream title
4558
- [`$(channel)`](channel.md): Shows information about the current channel
4659
- [`$(uptime)`](uptime.md): Displays how long the current stream has been live
60+
61+
## FAQ
62+
63+
**Q: How often does the game information update?**
64+
65+
A: The game information typically updates within a few seconds of changing the game on Twitch. However, the exact timing may vary.
66+
67+
**Q: What happens if no game is set?**
68+
69+
A: If no game is set for the channel, the `$(game)` variable will typically return "No game set" or a similar message.

docs/chatbot/variables/getcount.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,66 @@
11
---
22
id: getcount
3+
sidebar_label: "$(getcount)"
4+
description: "Learn how to use the $(getcount) variable in StreamElements Chatbot to retrieve counter values without incrementing them."
35
tags:
46
- chatbot
57
- variable
8+
- counter
9+
keywords:
10+
- StreamElements
11+
- chatbot
12+
- counter
13+
- variable
14+
- streaming
615
---
716

817
# $(getcount)
918

10-
Returns the current value of a counter without incrementing it.
19+
## Overview
1120

12-
#### Parameters
21+
The `$(getcount)` variable allows you to retrieve the current value of a counter without incrementing it. This is useful for displaying counter values in chat messages or on stream overlays.
1322

14-
This variable takes the name of the counter to get as a parameter.
23+
## Usage
1524

16-
#### Example Input
25+
To use the `$(getcount)` variable, you need to provide the name of the counter as a parameter. The syntax is as follows:
1726

1827
```
19-
$(getcount example)
28+
$(getcount counterName)
2029
```
2130

22-
#### Example Output
31+
## Examples
32+
33+
Here are two practical examples of how to use the `$(getcount)` variable:
34+
35+
1. Displaying the current number of subscribers:
2336

2437
```
25-
420
38+
We currently have $(getcount subscribers) subscribers! Thank you for your support!
2639
```
40+
41+
2. Showing the number of times a specific command has been used:
42+
43+
```
44+
The !hug command has been used $(getcount hugs) times in this stream.
45+
```
46+
47+
## Parameters
48+
49+
The `$(getcount)` variable takes one parameter:
50+
51+
- `counterName`: The name of the counter you want to retrieve the value for. This is a required parameter.
52+
53+
## Related Variables
54+
55+
- [`$(count)`](count.md): Increments a counter and returns its new value
56+
57+
## FAQ
58+
59+
**Q: Can I use $(getcount) to create a new counter?**
60+
A: No, `$(getcount)` only retrieves existing counter values. To create a new counter, use the `$(count)` variable first.
61+
62+
**Q: What happens if I try to get the count of a non-existent counter?**
63+
A: If the counter doesn't exist, `$(getcount)` will return 0.
64+
65+
**Q: Is there a limit to how many counters I can have?**
66+
A: StreamElements doesn't specify a limit, but it's good practice to use counters judiciously to avoid performance issues.
Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
11
---
22
id: leagueoflegends
3+
sidebar_label: "$(leagueoflegends)"
4+
description: "Get a League of Legends player's rank and LP using StreamElements Chatbot. Supports Riot IDs and multiple regions."
35
tags:
46
- chatbot
57
- variable
68
- League of Legends
7-
description: Outputs the summoner rank and LP of a specified League of Legends player
89
keywords:
910
- streamelements lol rank command
1011
- league of legends command
12+
- riot id rank lookup
13+
- summoner rank checker
1114
---
1215

13-
# $(leagueoflegends)
16+
# $(leagueoflegends) Variable
1417

15-
Outputs the summoner rank and LP of a specified League of Legends player.
18+
## Overview
1619

17-
:::info Riot IDs
18-
League of legends is transitioning to Riot IDs. This means that you will need to use your Riot ID instead of your summoner name.
20+
The `$(leagueoflegends)` variable allows you to retrieve and display the current rank and LP (League Points) of a specified League of Legends player using the StreamElements Chatbot.
21+
22+
## Usage
23+
24+
To use this variable, you need to provide two parameters: the region and the player's Riot ID or Summoner Name.
25+
26+
```
27+
$(leagueoflegends <region> <Riot ID/Summoner Name>)
28+
```
1929

20-
During the transition period, you can use either your Riot ID or your summoner name. After the transition period, you will only be able to use your Riot ID.
30+
:::info Riot IDs
31+
League of Legends is transitioning to Riot IDs. During the transition, you can use either Riot IDs or Summoner Names. After the transition, only Riot IDs will be supported.
2132
:::
2233

23-
#### Parameters
34+
**Note:** If the Riot ID contains spaces, wrap it in quotes.
35+
36+
## Examples
37+
38+
```
39+
$(leagueoflegends euw styler#euw)
40+
$(leagueoflegends na "Doublelift#na1")
41+
```
2442

25-
This variable takes two parameters:
43+
Example output:
44+
```
45+
Current Rank: Challenger I (1229 LP)
46+
```
2647

27-
1. Region
28-
2. Riot ID/Summoner Name
48+
## Parameters
2949

30-
**NOTE:** If your Riot ID contains one or more spaces, you will need to wrap it in quotes.
50+
1. **Region**: The server region of the player (e.g., `euw`, `na`)
51+
2. **Riot ID/Summoner Name**: The player's unique identifier
3152

32-
#### Supported Regions
53+
## Supported Regions
3354

3455
- `br` (Brazil)
3556
- `eune` (Europe Nordic & East)
@@ -49,15 +70,8 @@ This variable takes two parameters:
4970
- `tr` (Turkey)
5071
- `vn` (Vietnam)
5172

52-
#### Example Input
53-
54-
```
55-
$(leagueoflegends styler#euw euw)
56-
$(leagueoflegends "styler#euw" euw)
57-
```
73+
## FAQ
5874

59-
#### Example Output
75+
**Q: Why isn't the rank updating immediately?**
6076

61-
```
62-
Current Rank: Challenger I (1229 LP)
63-
```
77+
A: Rank data may have a slight delay due to API caching. It typically updates within a few minutes after a player's ranked game.

docs/chatbot/variables/math.md

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,78 @@
11
---
22
id: math
3+
sidebar_label: "$(math)"
4+
description: "Learn how to use the $(math) variable in StreamElements Chatbot for performing mathematical calculations in chat messages."
35
tags:
46
- chatbot
57
- variable
8+
- math
9+
keywords:
10+
- StreamElements
11+
- chatbot
12+
- math
13+
- calculations
14+
- expressions
615
---
716

8-
# $(math)
17+
# $(math) Variable
918

10-
Outputs the result of a math.js expression.
19+
## Overview
1120

12-
#### Parameters
21+
The `$(math)` variable allows you to perform mathematical calculations and operations directly in your StreamElements Chatbot messages. It utilizes the math.js library, providing a wide range of mathematical functions and capabilities.
1322

14-
This variable takes a math.js expression as a parameter. You can also use math.js functions like `round()`, `floor()`, `log()`, `random()`, etc.
23+
## Usage
1524

16-
#### Example Input
25+
To use the `$(math)` variable, include it in your message followed by a valid math.js expression:
1726

1827
```
19-
${math 2 + 2}
20-
${math round(10/3)}
21-
${math random(1,10)}
28+
$(math *expression*)
2229
```
2330

24-
#### Example Output
31+
Replace *expression* with the mathematical operation you want to perform.
2532

26-
```
27-
4
28-
3
29-
7.525986609745358
30-
```
33+
## Examples
34+
35+
Here are some practical examples of how to use the `$(math)` variable:
36+
37+
1. Basic arithmetic:
38+
```
39+
Bot: 2 + 2 equals $(math "2 + 2")
40+
Output: 2 + 2 equals 4
41+
```
42+
43+
2. Rounding a division result:
44+
```
45+
Bot: 10 divided by 3, rounded to the nearest integer, is $(math "round(10/3)")
46+
Output: 10 divided by 3, rounded to the nearest integer, is 3
47+
```
48+
49+
3. Generating a random number:
50+
```
51+
Bot: Your random number between 1 and 10 is $(math "random(1,10)")
52+
Output: Your random number between 1 and 10 is 7.525986609745358
53+
```
54+
55+
## Parameters
56+
57+
The `$(math)` variable takes a single parameter: a valid math.js expression. This can include:
58+
59+
- Basic arithmetic operations (`+`, `-`, `*`, `/`)
60+
- Mathematical functions (e.g., `round()`, `floor()`, `ceil()`, `log()`, `sin()`, `cos()`)
61+
- Constants (e.g., `pi`, `e`)
62+
- Logical operators (e.g., `>`, `<`, `==`, `!=`)
63+
64+
For a complete list of supported operations and functions, refer to the [math.js documentation](https://mathjs.org/docs/index.html).
65+
66+
## Related Variables
67+
68+
- [`$(customapi)`](customapi.md): Can be used to fetch and process numerical data from external sources
69+
70+
## FAQ
71+
72+
**Q: Can I use variables in my math expressions?**
73+
74+
A: Yes, you can use other StreamElements variables within your `$(math)` expression. For example: `$(math "{points} * 2")` would double the user's points.
75+
76+
**Q: Is there a limit to the complexity of expressions I can use?**
77+
78+
A: While there's no strict limit, very complex expressions may take longer to process. It's best to keep expressions relatively simple for optimal performance.

docs/chatbot/variables/msgid.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,51 @@
11
---
22
id: msgid
3+
sidebar_label: "$(msgid)"
4+
description: "Learn how to use the $(msgid) variable to retrieve unique message IDs in StreamElements Chatbot commands."
35
tags:
46
- chatbot
57
- variable
8+
- message id
9+
keywords:
10+
- StreamElements
11+
- chatbot
12+
- message ID
13+
- command trigger
14+
- unique identifier
615
---
716

8-
# $(msgid)
17+
# $(msgid) Variable
918

10-
Outputs the message ID of the message that triggered the command.
19+
## Overview
1120

12-
#### Parameters
21+
The `$(msgid)` variable is a powerful tool in the StreamElements Chatbot that outputs the unique message ID of the message that triggered a command. This can be useful for tracking specific messages, debugging, or creating advanced custom functionality in your stream.
1322

14-
This variable does not take any parameters.
23+
## Usage
1524

16-
#### Example Input
25+
To use the `$(msgid)` variable, simply include it in your command response or custom script. The chatbot will automatically replace it with the actual message ID when the command is triggered.
1726

18-
```
19-
$(msgid)
20-
```
27+
## Examples
2128

22-
#### Example Output
29+
Here are two practical examples of how you might use the `$(msgid)` variable:
30+
31+
1. Basic usage in a command response:
2332

2433
```
25-
bcc9b4bc-566d-4f14-a57d-a86c1c3196f8
34+
!messageid
35+
Bot: The ID of the message that triggered this command is: $(msgid)
2636
```
37+
38+
## Parameters
39+
40+
The `$(msgid)` variable does not accept any parameters. It simply returns the message ID of the triggering message.
41+
42+
## Related Commands
43+
44+
- [`$(user)`](user.md): Returns the username of the person who triggered the command
45+
- [`$(channel)`](channel.md): Returns the name of the channel where the command was triggered
46+
47+
## FAQ
48+
49+
**Q: What format does the message ID use?**
50+
51+
A: The message ID is typically a UUID (Universally Unique Identifier) in the format of a string of letters and numbers separated by hyphens, such as `bcc9b4bc-566d-4f14-a57d-a86c1c3196f8`.

0 commit comments

Comments
 (0)