Skip to content

Commit 50bf87f

Browse files
committed
feat: Add $(user) variable for user-related info
1 parent 47ff7ff commit 50bf87f

11 files changed

Lines changed: 707 additions & 343 deletions

File tree

docs/chatbot/variables/sender.md

Lines changed: 81 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -1,270 +1,169 @@
11
---
22
id: sender
3+
sidebar_label: "$(sender)"
4+
description: "Comprehensive guide to the StreamElements Chatbot $(sender) variable for streamers and moderators"
35
tags:
46
- chatbot
57
- variable
8+
- sender
9+
keywords:
10+
- streamelements
11+
- chatbot
12+
- sender variable
13+
- streamer tools
14+
- chat commands
615
---
716

8-
# $(sender)
17+
# $(sender) Variable
18+
19+
## Overview
20+
21+
The `$(sender)` variable in StreamElements Chatbot always refers to the user who triggered the command or message. It provides access to various user-related information such as username, loyalty points, ranks, and activity timestamps.
922

10-
Displays the message sender’s display name
23+
:::tip Key Point
24+
`$(sender)` always refers to the command trigger and doesn't accept arguments. If you need to query information about other users, use the [`$(user)`](user.md) variable instead.
25+
:::
1126

1227
## Aliases
1328

14-
`$(source)` can also be used.
29+
`$(source)` can also be used as an alias for `$(sender)`.
1530

16-
#### Parameters
31+
## Usage
1732

18-
This variable does not take any parameters.
33+
To use the `$(sender)` variable, include it in your chat message or command response using the `$()` syntax. For example, `$(sender)` will display the command trigger's display name.
1934

20-
#### Example Input
35+
## Available sender Variables
2136

22-
```
23-
Current user: $(sender)
24-
```
37+
### $(sender)
2538

26-
#### Example Output
39+
Displays the message sender's display name.
2740

41+
**Example:**
2842
```
29-
Current user: styler
43+
Current user: $(sender)
3044
```
45+
**Output:** `Current user: Styler`
3146

32-
## $(sender.name)
33-
34-
Displays the user’s display name in lowercase letters
35-
36-
#### Parameters
47+
### $(sender.name)
3748

38-
This variable does not take any parameters.
39-
40-
#### Example Input
49+
Displays the sender's display name in lowercase letters.
4150

51+
**Example:**
4252
```
4353
Current user: $(sender.name)
4454
```
55+
**Output:** `Current user: styler`
4556

46-
#### Example Output
47-
48-
```
49-
Current user: styler
50-
```
51-
52-
## $(sender.points)
53-
54-
Displays the user’s loyalty currency owned
57+
### $(sender.points)
5558

56-
#### Parameters
57-
58-
This variable does not take any parameters.
59-
60-
#### Example Input
59+
Displays the sender's loyalty currency owned.
6160

61+
**Example:**
6262
```
6363
$(sender) has $(sender.points) points
6464
```
65+
**Output:** `Styler has 100 points`
6566

66-
#### Example Output
67-
68-
```
69-
styler has 100 points
70-
```
71-
72-
## $(sender.points_rank)
73-
74-
Displays the user’s rank on the loyalty currency leaderboard
75-
76-
#### Parameters
77-
78-
This variable does not take any parameters.
67+
### $(sender.points_rank)
7968

80-
#### Example Input
69+
Displays the sender's rank on the loyalty currency leaderboard.
8170

71+
**Example:**
8272
```
8373
$(sender) is rank $(sender.points_rank) on the leaderboard
8474
```
75+
**Output:** `Styler is rank 5/283 on the leaderboard`
8576

86-
#### Example Output
77+
### $(sender.points_alltime_rank)
8778

88-
```
89-
styler is rank 5/283 on the leaderboard
90-
```
91-
92-
## $(sender.points_alltime_rank)
93-
94-
Displays the user’s rank on the alltime loyalty currency leaderboard
95-
96-
#### Parameters
97-
98-
This variable does not take any parameters.
99-
100-
#### Example Input
101-
102-
```
103-
$(sender) is rank $(sender.points_alltime_rank) on the alltime leaderboard
104-
```
105-
106-
#### Example Output
79+
Displays the sender's rank on the all-time loyalty currency leaderboard.
10780

81+
**Example:**
10882
```
109-
styler is rank 5/283 on the alltime leaderboard
83+
$(sender) is rank $(sender.points_alltime_rank) on the all-time leaderboard
11084
```
85+
**Output:** `Styler is rank 5/283 on the all-time leaderboard`
11186

112-
## $(sender.level)
113-
114-
Displays the user’s access level
87+
### $(sender.level)
11588

116-
#### Parameters
117-
118-
This variable does not take any parameters.
119-
120-
#### Example Input
89+
Displays the sender's access level.
12190

91+
**Example:**
12292
```
12393
$(sender) is level $(sender.level)
12494
```
95+
**Output:** `Styler is level 2000`
12596

126-
#### Example Output
127-
128-
```
129-
styler is level 2000
130-
```
131-
132-
## $(sender.lastmessage)
97+
### $(sender.lastmessage)
13398

134-
Displays the user’s last typed message in the chat
135-
136-
#### Parameters
137-
138-
This variable does not take any parameters.
139-
140-
#### Example Input
99+
Displays the sender's last typed message in the chat.
141100

101+
**Example:**
142102
```
143103
$(sender) last typed: $(sender.lastmessage)
144104
```
105+
**Output:** `Styler last typed: !points`
145106

146-
#### Example Output
147-
148-
```
149-
styler last typed: !points
150-
```
151-
152-
## $(sender.lastseen)
153-
154-
Displays the time that a user was most recently seen in viewer list or chat
107+
### $(sender.lastseen)
155108

156-
#### Parameters
157-
158-
This variable does not take any parameters.
159-
160-
#### Example Input
109+
Displays the time that the sender was most recently seen in the viewer list or chat.
161110

111+
**Example:**
162112
```
163113
$(sender) was last seen $(sender.lastseen) ago
164114
```
115+
**Output:** `Styler was last seen 13m 15s ago`
165116

166-
#### Example Output
167-
168-
```
169-
styler was last seen 13m 15s ago
170-
```
171-
172-
## $(sender.lastactive)
173-
174-
Displays the time that a user most recently typed a message in the chat
175-
176-
#### Parameters
177-
178-
This variable does not take any parameters.
117+
### $(sender.lastactive)
179118

180-
#### Example Input
119+
Displays the time that the sender most recently typed a message in the chat.
181120

121+
**Example:**
182122
```
183123
$(sender) was last active $(sender.lastactive) ago
184124
```
125+
**Output:** `Styler was last active 13m 15s ago`
185126

186-
#### Example Output
127+
### $(sender.time_online)
187128

188-
```
189-
styler was last active 13m 15s ago
190-
```
191-
192-
## $(sender.time_online)
193-
194-
Displays the total time a user has been in the chat while stream is offline
195-
196-
#### Parameters
197-
198-
This variable does not take any parameters.
199-
200-
#### Example Input
201-
202-
```
203-
$(sender) has been in the chat for $(sender.time_online)
204-
```
205-
206-
#### Example Output
207-
208-
```
209-
styler has been in the chat for 27m 16s
210-
```
211-
212-
## $(sender.time_online)
213-
214-
Displays the user’s display name
215-
216-
#### Parameters
217-
218-
Displays the total time a user has spent watching the stream
219-
220-
#### Example Input
129+
Displays the total time the sender has spent watching the stream.
221130

131+
**Example:**
222132
```
223133
$(sender) has been watching the stream for $(sender.time_online)
224134
```
135+
**Output:** `Styler has been watching the stream for 27m 16s`
225136

226-
#### Example Output
227-
228-
```
229-
styler has been watching the stream for 27m 16s
230-
```
231-
232-
## $(sender.time_online_rank)
233-
234-
Displays the user’s rank on the leaderboard for online time watched
137+
### $(sender.time_online_rank)
235138

236-
#### Parameters
237-
238-
This variable does not take any parameters.
239-
240-
#### Example Input
139+
Displays the sender's rank on the leaderboard for online time watched.
241140

141+
**Example:**
242142
```
243143
$(sender) is rank $(sender.time_online_rank) on the online leaderboard
244144
```
145+
**Output:** `Styler is rank 5/283 on the online leaderboard`
146+
147+
### $(sender.time_offline_rank)
245148

246-
#### Example Output
149+
Displays the sender's rank on the leaderboard for offline time watched.
247150

151+
**Example:**
248152
```
249-
styler is rank 5/283 on the online leaderboard
153+
$(sender) is rank $(sender.time_offline_rank) on the offline leaderboard
250154
```
155+
**Output:** `Styler is rank 5/283 on the offline leaderboard`
251156

252-
## $(sender.time_offline_rank)
157+
## Best Practices
253158

254-
Displays the user’s rank on the leaderboard for offline time watched
159+
1. Use `$(sender)` when you only need information about the command trigger.
160+
2. If you need to reference other users or allow flexible user queries, use the [`$(user)`](user.md) variable instead.
255161

256-
#### Parameters
162+
## Troubleshooting
257163

258-
This variable does not take any parameters.
164+
- If a variable returns unexpected results, ensure you're using the correct syntax and that the user exists in your channel's database.
165+
- Remember that `$(sender)` variables don't accept arguments. If you need to query other users, use `$(user)` instead.
259166

260-
#### Example Input
167+
## Related Documentation
261168

262-
```
263-
$(sender) is rank $(sender.time_offline_rank) on the offline leaderboard
264-
```
265-
266-
#### Example Output
267-
268-
```
269-
styler is rank 5/283 on the offline leaderboard
270-
```
169+
- For querying information about any user, see the [`$(user)` variable documentation](user.md).

0 commit comments

Comments
 (0)