|
1 | 1 | --- |
2 | 2 | id: sender |
| 3 | +sidebar_label: "$(sender)" |
| 4 | +description: "Comprehensive guide to the StreamElements Chatbot $(sender) variable for streamers and moderators" |
3 | 5 | tags: |
4 | 6 | - chatbot |
5 | 7 | - variable |
| 8 | + - sender |
| 9 | +keywords: |
| 10 | + - streamelements |
| 11 | + - chatbot |
| 12 | + - sender variable |
| 13 | + - streamer tools |
| 14 | + - chat commands |
6 | 15 | --- |
7 | 16 |
|
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. |
9 | 22 |
|
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 | +::: |
11 | 26 |
|
12 | 27 | ## Aliases |
13 | 28 |
|
14 | | -`$(source)` can also be used. |
| 29 | +`$(source)` can also be used as an alias for `$(sender)`. |
15 | 30 |
|
16 | | -#### Parameters |
| 31 | +## Usage |
17 | 32 |
|
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. |
19 | 34 |
|
20 | | -#### Example Input |
| 35 | +## Available sender Variables |
21 | 36 |
|
22 | | -``` |
23 | | -Current user: $(sender) |
24 | | -``` |
| 37 | +### $(sender) |
25 | 38 |
|
26 | | -#### Example Output |
| 39 | +Displays the message sender's display name. |
27 | 40 |
|
| 41 | +**Example:** |
28 | 42 | ``` |
29 | | -Current user: styler |
| 43 | +Current user: $(sender) |
30 | 44 | ``` |
| 45 | +**Output:** `Current user: Styler` |
31 | 46 |
|
32 | | -## $(sender.name) |
33 | | - |
34 | | -Displays the user’s display name in lowercase letters |
35 | | - |
36 | | -#### Parameters |
| 47 | +### $(sender.name) |
37 | 48 |
|
38 | | -This variable does not take any parameters. |
39 | | - |
40 | | -#### Example Input |
| 49 | +Displays the sender's display name in lowercase letters. |
41 | 50 |
|
| 51 | +**Example:** |
42 | 52 | ``` |
43 | 53 | Current user: $(sender.name) |
44 | 54 | ``` |
| 55 | +**Output:** `Current user: styler` |
45 | 56 |
|
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) |
55 | 58 |
|
56 | | -#### Parameters |
57 | | - |
58 | | -This variable does not take any parameters. |
59 | | - |
60 | | -#### Example Input |
| 59 | +Displays the sender's loyalty currency owned. |
61 | 60 |
|
| 61 | +**Example:** |
62 | 62 | ``` |
63 | 63 | $(sender) has $(sender.points) points |
64 | 64 | ``` |
| 65 | +**Output:** `Styler has 100 points` |
65 | 66 |
|
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) |
79 | 68 |
|
80 | | -#### Example Input |
| 69 | +Displays the sender's rank on the loyalty currency leaderboard. |
81 | 70 |
|
| 71 | +**Example:** |
82 | 72 | ``` |
83 | 73 | $(sender) is rank $(sender.points_rank) on the leaderboard |
84 | 74 | ``` |
| 75 | +**Output:** `Styler is rank 5/283 on the leaderboard` |
85 | 76 |
|
86 | | -#### Example Output |
| 77 | +### $(sender.points_alltime_rank) |
87 | 78 |
|
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. |
107 | 80 |
|
| 81 | +**Example:** |
108 | 82 | ``` |
109 | | -styler is rank 5/283 on the alltime leaderboard |
| 83 | +$(sender) is rank $(sender.points_alltime_rank) on the all-time leaderboard |
110 | 84 | ``` |
| 85 | +**Output:** `Styler is rank 5/283 on the all-time leaderboard` |
111 | 86 |
|
112 | | -## $(sender.level) |
113 | | - |
114 | | -Displays the user’s access level |
| 87 | +### $(sender.level) |
115 | 88 |
|
116 | | -#### Parameters |
117 | | - |
118 | | -This variable does not take any parameters. |
119 | | - |
120 | | -#### Example Input |
| 89 | +Displays the sender's access level. |
121 | 90 |
|
| 91 | +**Example:** |
122 | 92 | ``` |
123 | 93 | $(sender) is level $(sender.level) |
124 | 94 | ``` |
| 95 | +**Output:** `Styler is level 2000` |
125 | 96 |
|
126 | | -#### Example Output |
127 | | - |
128 | | -``` |
129 | | -styler is level 2000 |
130 | | -``` |
131 | | - |
132 | | -## $(sender.lastmessage) |
| 97 | +### $(sender.lastmessage) |
133 | 98 |
|
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. |
141 | 100 |
|
| 101 | +**Example:** |
142 | 102 | ``` |
143 | 103 | $(sender) last typed: $(sender.lastmessage) |
144 | 104 | ``` |
| 105 | +**Output:** `Styler last typed: !points` |
145 | 106 |
|
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) |
155 | 108 |
|
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. |
161 | 110 |
|
| 111 | +**Example:** |
162 | 112 | ``` |
163 | 113 | $(sender) was last seen $(sender.lastseen) ago |
164 | 114 | ``` |
| 115 | +**Output:** `Styler was last seen 13m 15s ago` |
165 | 116 |
|
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) |
179 | 118 |
|
180 | | -#### Example Input |
| 119 | +Displays the time that the sender most recently typed a message in the chat. |
181 | 120 |
|
| 121 | +**Example:** |
182 | 122 | ``` |
183 | 123 | $(sender) was last active $(sender.lastactive) ago |
184 | 124 | ``` |
| 125 | +**Output:** `Styler was last active 13m 15s ago` |
185 | 126 |
|
186 | | -#### Example Output |
| 127 | +### $(sender.time_online) |
187 | 128 |
|
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. |
221 | 130 |
|
| 131 | +**Example:** |
222 | 132 | ``` |
223 | 133 | $(sender) has been watching the stream for $(sender.time_online) |
224 | 134 | ``` |
| 135 | +**Output:** `Styler has been watching the stream for 27m 16s` |
225 | 136 |
|
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) |
235 | 138 |
|
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. |
241 | 140 |
|
| 141 | +**Example:** |
242 | 142 | ``` |
243 | 143 | $(sender) is rank $(sender.time_online_rank) on the online leaderboard |
244 | 144 | ``` |
| 145 | +**Output:** `Styler is rank 5/283 on the online leaderboard` |
| 146 | + |
| 147 | +### $(sender.time_offline_rank) |
245 | 148 |
|
246 | | -#### Example Output |
| 149 | +Displays the sender's rank on the leaderboard for offline time watched. |
247 | 150 |
|
| 151 | +**Example:** |
248 | 152 | ``` |
249 | | -styler is rank 5/283 on the online leaderboard |
| 153 | +$(sender) is rank $(sender.time_offline_rank) on the offline leaderboard |
250 | 154 | ``` |
| 155 | +**Output:** `Styler is rank 5/283 on the offline leaderboard` |
251 | 156 |
|
252 | | -## $(sender.time_offline_rank) |
| 157 | +## Best Practices |
253 | 158 |
|
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. |
255 | 161 |
|
256 | | -#### Parameters |
| 162 | +## Troubleshooting |
257 | 163 |
|
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. |
259 | 166 |
|
260 | | -#### Example Input |
| 167 | +## Related Documentation |
261 | 168 |
|
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