Activity
Activity variables expose the activity that triggered the command. They only resolve when the command runs from an activity trigger.
If the same response runs from a chat message trigger, activity variables are left unchanged.
Command scripts use the same field names on ctx.activity.
For example, {activity.viewer_display_name} in a response is
ctx.activity.viewer_display_name in a script.
Example
Section titled “Example”For a Twitch resub activity, this can produce:
Fields
Section titled “Fields”| Field | Use | Example |
|---|---|---|
viewer_display_name | Display name of the viewer who triggered the activity. | TestUser |
viewer_name | Viewer username/login. | testuser |
type_display_name | Readable activity type name. | Resub |
type | Raw activity type. | resub |
sub_type_display_name | Readable subtype when the activity has one. | T1 |
sub_type | Raw subtype. | 1000 |
count | Raw number from the activity. | 12 |
amount | Display value. Includes currency when the activity has one. | 12.34 USD |
count_name | Count unit. | months |
message | User-entered activity message when available. | Great stream! |
system_message | Platform-generated message when available. | TestUser subscribed |
recipient_display_name | First gift recipient display name when available. | GiftReceiver |
provider | Provider that created the activity. | twitch |
provider_message_id | Provider message ID. | abc-123 |
created_at | Activity time as an ISO timestamp. | 2026-07-02T20:15:30+00:00 |
Use a field in a command response like this:
Use the same field in a command script like this:
Count and amount
Section titled “Count and amount”Use count when you need the raw number.
Use amount when you want the value formatted for chat.
For example, a donation stored as 1234 with two decimal places becomes: