@lumiastream/lumia-types 3.2.8 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity.types.d.ts +6 -0
- package/dist/activity.types.js +6 -0
- package/dist/alert.types.js +146 -0
- package/dist/custom-overlays/custom-overlays-cheatsheet.md +1 -0
- package/dist/custom-overlays/custom-overlays-documentation.md +54 -1
- package/dist/custom-overlays/custom-overlays-examples.md +1 -1
- package/dist/custom-overlays/custom-overlays.d.ts +70 -39
- package/dist/custom-overlays/gpt-instructions.md +2 -0
- package/dist/custom-overlays.d.ts +70 -39
- package/dist/eventlist.types.d.ts +1 -0
- package/dist/eventlist.types.js +1 -0
- package/dist/variables.types.d.ts +12 -0
- package/dist/variables.types.js +31 -0
- package/package.json +1 -1
package/dist/activity.types.d.ts
CHANGED
|
@@ -287,6 +287,10 @@ export declare enum LumiaAlertValues {
|
|
|
287
287
|
YOUTUBE_SUPERSTICKER = "youtube-supersticker",
|
|
288
288
|
/** YouTube session superstickers */
|
|
289
289
|
YOUTUBE_SESSION_SUPERSTICKERS = "youtube-sessionSuperstickers",
|
|
290
|
+
/** YouTube gift event (jewel-based) */
|
|
291
|
+
YOUTUBE_GIFTS = "youtube-gifts",
|
|
292
|
+
/** YouTube session gifts */
|
|
293
|
+
YOUTUBE_SESSION_GIFTS = "youtube-sessionGifts",
|
|
290
294
|
/** YouTube total likes */
|
|
291
295
|
YOUTUBE_LIKE = "youtube-like",
|
|
292
296
|
/** YouTube total views */
|
|
@@ -622,6 +626,8 @@ export declare const LumiaAlertFriendlyValues: {
|
|
|
622
626
|
"youtube-subscriber": string;
|
|
623
627
|
"youtube-superchat": string;
|
|
624
628
|
"youtube-supersticker": string;
|
|
629
|
+
"youtube-gifts": string;
|
|
630
|
+
"youtube-sessionGifts": string;
|
|
625
631
|
"youtube-entrance": string;
|
|
626
632
|
"youtube-like": string;
|
|
627
633
|
"youtube-viewers": string;
|
package/dist/activity.types.js
CHANGED
|
@@ -303,6 +303,10 @@ var LumiaAlertValues;
|
|
|
303
303
|
LumiaAlertValues["YOUTUBE_SUPERSTICKER"] = "youtube-supersticker";
|
|
304
304
|
/** YouTube session superstickers */
|
|
305
305
|
LumiaAlertValues["YOUTUBE_SESSION_SUPERSTICKERS"] = "youtube-sessionSuperstickers";
|
|
306
|
+
/** YouTube gift event (jewel-based) */
|
|
307
|
+
LumiaAlertValues["YOUTUBE_GIFTS"] = "youtube-gifts";
|
|
308
|
+
/** YouTube session gifts */
|
|
309
|
+
LumiaAlertValues["YOUTUBE_SESSION_GIFTS"] = "youtube-sessionGifts";
|
|
306
310
|
/** YouTube total likes */
|
|
307
311
|
LumiaAlertValues["YOUTUBE_LIKE"] = "youtube-like";
|
|
308
312
|
/** YouTube total views */
|
|
@@ -652,6 +656,8 @@ exports.LumiaAlertFriendlyValues = {
|
|
|
652
656
|
[LumiaAlertValues.YOUTUBE_SUBSCRIBER]: 'Youtube Subscriber',
|
|
653
657
|
[LumiaAlertValues.YOUTUBE_SUPERCHAT]: 'Youtube Superchat',
|
|
654
658
|
[LumiaAlertValues.YOUTUBE_SUPERSTICKER]: 'Youtube Supersticker',
|
|
659
|
+
[LumiaAlertValues.YOUTUBE_GIFTS]: 'Youtube Gifts',
|
|
660
|
+
[LumiaAlertValues.YOUTUBE_SESSION_GIFTS]: 'Youtube Session Gifts',
|
|
655
661
|
[LumiaAlertValues.YOUTUBE_ENTRANCE]: 'Youtube Entrance',
|
|
656
662
|
[LumiaAlertValues.YOUTUBE_LIKE]: 'Youtube Like',
|
|
657
663
|
[LumiaAlertValues.YOUTUBE_VIEWERS]: 'Youtube Viewers',
|
package/dist/alert.types.js
CHANGED
|
@@ -3906,6 +3906,152 @@ exports.LumiaAlertConfigs = {
|
|
|
3906
3906
|
{ type: LumiaVariationConditions.COUNT_IS_MULTIPLE_OF, description: 'Total Session Gift Member Count is a multiple of' },
|
|
3907
3907
|
],
|
|
3908
3908
|
},
|
|
3909
|
+
[activity_types_1.LumiaAlertValues.YOUTUBE_GIFTS]: {
|
|
3910
|
+
connection: event_types_1.LumiaIntegrations.YOUTUBE,
|
|
3911
|
+
message: '{{username}} sent x{{comboCount}} {{giftName}} ({{jewelsAmount}} jewels)',
|
|
3912
|
+
eventlistMessage: 'Gift',
|
|
3913
|
+
eventlistDetailedMessage: 'sent x{{comboCount}} {{giftName}} worth {{jewelsAmount}} jewels',
|
|
3914
|
+
acceptedVariables: variables_types_1.AllVariables.youtube.alerts.gifts,
|
|
3915
|
+
quickActions: [
|
|
3916
|
+
{
|
|
3917
|
+
label: '10 Jewels',
|
|
3918
|
+
dynamic: { value: 10, name: 'Heart' },
|
|
3919
|
+
extraSettings: {
|
|
3920
|
+
username: 'lumiastream',
|
|
3921
|
+
displayname: 'LumiaStream',
|
|
3922
|
+
avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
|
|
3923
|
+
giftName: 'Heart',
|
|
3924
|
+
jewelsAmount: 10,
|
|
3925
|
+
totalJewels: 10,
|
|
3926
|
+
comboCount: 1,
|
|
3927
|
+
hasVisualEffect: false,
|
|
3928
|
+
},
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
label: '100 Jewels',
|
|
3932
|
+
dynamic: { value: 100, name: 'Rose' },
|
|
3933
|
+
extraSettings: {
|
|
3934
|
+
username: 'lumiastream',
|
|
3935
|
+
displayname: 'LumiaStream',
|
|
3936
|
+
avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
|
|
3937
|
+
giftName: 'Rose',
|
|
3938
|
+
jewelsAmount: 100,
|
|
3939
|
+
totalJewels: 100,
|
|
3940
|
+
comboCount: 1,
|
|
3941
|
+
hasVisualEffect: true,
|
|
3942
|
+
},
|
|
3943
|
+
},
|
|
3944
|
+
{
|
|
3945
|
+
label: '500 Jewels Combo',
|
|
3946
|
+
dynamic: { value: 500, name: 'Star' },
|
|
3947
|
+
extraSettings: {
|
|
3948
|
+
username: 'lumiastream',
|
|
3949
|
+
displayname: 'LumiaStream',
|
|
3950
|
+
avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
|
|
3951
|
+
giftName: 'Star',
|
|
3952
|
+
jewelsAmount: 500,
|
|
3953
|
+
totalJewels: 500,
|
|
3954
|
+
comboCount: 5,
|
|
3955
|
+
hasVisualEffect: true,
|
|
3956
|
+
},
|
|
3957
|
+
},
|
|
3958
|
+
],
|
|
3959
|
+
inputFields: [
|
|
3960
|
+
{
|
|
3961
|
+
type: 'text',
|
|
3962
|
+
label: 'Username',
|
|
3963
|
+
variableField: 'username',
|
|
3964
|
+
required: false,
|
|
3965
|
+
default: 'lumiastream',
|
|
3966
|
+
},
|
|
3967
|
+
{
|
|
3968
|
+
type: 'text',
|
|
3969
|
+
label: 'Gift Name',
|
|
3970
|
+
variableField: 'giftName',
|
|
3971
|
+
required: false,
|
|
3972
|
+
default: 'Rose',
|
|
3973
|
+
},
|
|
3974
|
+
{
|
|
3975
|
+
type: 'number',
|
|
3976
|
+
label: 'Jewels Amount',
|
|
3977
|
+
dynamicField: 'value',
|
|
3978
|
+
variableField: 'jewelsAmount',
|
|
3979
|
+
required: true,
|
|
3980
|
+
default: 100,
|
|
3981
|
+
},
|
|
3982
|
+
{
|
|
3983
|
+
type: 'number',
|
|
3984
|
+
label: 'Combo Count',
|
|
3985
|
+
variableField: 'comboCount',
|
|
3986
|
+
required: false,
|
|
3987
|
+
default: 1,
|
|
3988
|
+
},
|
|
3989
|
+
],
|
|
3990
|
+
LumiaVariationConditions: [
|
|
3991
|
+
{ type: LumiaVariationConditions.RANDOM },
|
|
3992
|
+
{
|
|
3993
|
+
type: LumiaVariationConditions.EQUAL_STRING,
|
|
3994
|
+
description: 'Gift Name is equal to',
|
|
3995
|
+
},
|
|
3996
|
+
{
|
|
3997
|
+
type: LumiaVariationConditions.EQUAL_NUMBER,
|
|
3998
|
+
description: 'Jewels is equal to',
|
|
3999
|
+
},
|
|
4000
|
+
{
|
|
4001
|
+
type: LumiaVariationConditions.GREATER_NUMBER,
|
|
4002
|
+
description: 'Jewels is greater than',
|
|
4003
|
+
},
|
|
4004
|
+
{ type: LumiaVariationConditions.EQUAL_USERNAME },
|
|
4005
|
+
{ type: LumiaVariationConditions.EQUAL_VARIABLE },
|
|
4006
|
+
],
|
|
4007
|
+
},
|
|
4008
|
+
[activity_types_1.LumiaAlertValues.YOUTUBE_SESSION_GIFTS]: {
|
|
4009
|
+
connection: event_types_1.LumiaIntegrations.YOUTUBE,
|
|
4010
|
+
message: 'Reached {{total}} jewels this session',
|
|
4011
|
+
eventlistMessage: 'Total Gifts {{total}}',
|
|
4012
|
+
eventlistDetailedMessage: 'reached {{total}} jewels',
|
|
4013
|
+
acceptedVariables: variables_types_1.AllVariables.youtube.alerts.sessionGifts,
|
|
4014
|
+
eventlistSpecialUsername: 'Total Gifts',
|
|
4015
|
+
quickActions: [
|
|
4016
|
+
{
|
|
4017
|
+
label: '100 Total Jewels',
|
|
4018
|
+
dynamic: { value: 100, total: 100, previousTotal: 50 },
|
|
4019
|
+
extraSettings: { total: 100, previousTotal: 50 },
|
|
4020
|
+
},
|
|
4021
|
+
{
|
|
4022
|
+
label: '500 Total Jewels',
|
|
4023
|
+
dynamic: { value: 500, total: 500, previousTotal: 100 },
|
|
4024
|
+
extraSettings: { total: 500, previousTotal: 100 },
|
|
4025
|
+
},
|
|
4026
|
+
{
|
|
4027
|
+
label: '1000 Total Jewels',
|
|
4028
|
+
dynamic: { value: 1000, total: 1000, previousTotal: 500 },
|
|
4029
|
+
extraSettings: { total: 1000, previousTotal: 500 },
|
|
4030
|
+
},
|
|
4031
|
+
],
|
|
4032
|
+
inputFields: [
|
|
4033
|
+
{
|
|
4034
|
+
type: 'number',
|
|
4035
|
+
label: 'Total Jewels',
|
|
4036
|
+
dynamicField: 'value',
|
|
4037
|
+
variableField: 'total',
|
|
4038
|
+
required: true,
|
|
4039
|
+
default: 100,
|
|
4040
|
+
},
|
|
4041
|
+
{
|
|
4042
|
+
type: 'number',
|
|
4043
|
+
label: 'Previous Total',
|
|
4044
|
+
dynamicField: 'previousTotal',
|
|
4045
|
+
variableField: 'previousTotal',
|
|
4046
|
+
required: false,
|
|
4047
|
+
default: 0,
|
|
4048
|
+
},
|
|
4049
|
+
],
|
|
4050
|
+
LumiaVariationConditions: [
|
|
4051
|
+
{ type: LumiaVariationConditions.GREATER_NUMBER, description: 'Total Session Jewels Greater Than' },
|
|
4052
|
+
{ type: LumiaVariationConditions.COUNT_IS_MULTIPLE_OF, description: 'Total Session Jewels is a multiple of' },
|
|
4053
|
+
],
|
|
4054
|
+
},
|
|
3909
4055
|
[activity_types_1.LumiaAlertValues.YOUTUBE_SUPERCHAT]: {
|
|
3910
4056
|
connection: event_types_1.LumiaIntegrations.YOUTUBE,
|
|
3911
4057
|
message: '{{username}} just super chatted with {{currencySymbol}}{{amount}}. They said {{message}}',
|
|
@@ -18,6 +18,7 @@ Runtime reminders:
|
|
|
18
18
|
- Read Config/Data values from `Overlay.data`, not from a bare top-level `data` variable.
|
|
19
19
|
- JS is already wrapped by Lumia in an async function, so top-level `await` is allowed.
|
|
20
20
|
- Use literal listener names like `Overlay.on('chat', ...)` so Lumia can auto-subscribe to events.
|
|
21
|
+
- For full event payload shapes, use the Overlay Type Definitions page or `custom-overlays.d.ts`.
|
|
21
22
|
- Use `Overlay.deleteStorage`, not `Overlay.removeStorage`.
|
|
22
23
|
|
|
23
24
|
### `window.Overlay` interface
|
|
@@ -106,6 +106,57 @@ Overlay.on("chat", (data) => {
|
|
|
106
106
|
toast(`New chat message received from ${username}. They said ${message}`);
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
+
// Full chat payload shape.
|
|
110
|
+
Overlay.on("chat", (data) => {
|
|
111
|
+
const {
|
|
112
|
+
origin, // Platform origin, such as "twitch", "youtube", "kick", "tiktok", or "facebook"
|
|
113
|
+
id, // Platform message id when available
|
|
114
|
+
username, // Account username/login
|
|
115
|
+
displayname, // Display name when available
|
|
116
|
+
channel, // Channel or room where the message was sent
|
|
117
|
+
avatar, // User avatar URL when available
|
|
118
|
+
message, // Chat message text
|
|
119
|
+
color, // User chat color, usually a hex value
|
|
120
|
+
badges, // Badge ids or badge image URLs
|
|
121
|
+
badgesLookup, // Badge id to image URL lookup map for some platforms
|
|
122
|
+
badgesRaw, // Raw platform badge string
|
|
123
|
+
emotesRaw, // Raw platform emote string
|
|
124
|
+
emotesPack, // Platform-specific emote metadata
|
|
125
|
+
isCheer, // Whether the message includes a cheer/bits event
|
|
126
|
+
reply, // Reply metadata: { username, body }
|
|
127
|
+
isPowerup, // Twitch Power-up flag
|
|
128
|
+
powerupType, // Twitch Power-up type
|
|
129
|
+
powerupName, // Twitch Power-up animation name
|
|
130
|
+
sharedMessage, // Twitch shared chat source metadata
|
|
131
|
+
lumiauserlevels, // Numeric Lumia user level ids
|
|
132
|
+
userLevels, // Boolean role map: isSelf, broadcaster, mod, vip, tier3, tier2, subscriber, regular, follower, anyone
|
|
133
|
+
time, // Local HH:mm:ss time generated by Lumia
|
|
134
|
+
timestamp, // Millisecond timestamp generated by Lumia
|
|
135
|
+
} = data;
|
|
136
|
+
|
|
137
|
+
console.log(origin, displayname || username, message, {
|
|
138
|
+
id,
|
|
139
|
+
channel,
|
|
140
|
+
avatar,
|
|
141
|
+
color,
|
|
142
|
+
badges,
|
|
143
|
+
badgesLookup,
|
|
144
|
+
badgesRaw,
|
|
145
|
+
emotesRaw,
|
|
146
|
+
emotesPack,
|
|
147
|
+
isCheer,
|
|
148
|
+
reply,
|
|
149
|
+
isPowerup,
|
|
150
|
+
powerupType,
|
|
151
|
+
powerupName,
|
|
152
|
+
sharedMessage,
|
|
153
|
+
lumiauserlevels,
|
|
154
|
+
userLevels,
|
|
155
|
+
time,
|
|
156
|
+
timestamp,
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
109
160
|
Overlay.on("alert", (data) => {
|
|
110
161
|
console.log("alert", data);
|
|
111
162
|
const settings = data.extraSettings || {};
|
|
@@ -199,6 +250,8 @@ Overlay.on('overlaycontent', (data) => {
|
|
|
199
250
|
|
|
200
251
|
Lumia auto-detects event subscriptions from literal `Overlay.on("event", ...)` calls in the JS tab. Use direct string literals so the overlay subscribes to the needed events. The Data tab only needs an `events` array for legacy/manual cases.
|
|
201
252
|
|
|
253
|
+
For full event payload shapes, see the [Overlay Type Definitions](/docs/custom-overlays/types). The raw declarations live in `custom-overlays.d.ts` as `ChatEvent`, `AlertEvent`, `HfxEvent`, `VirtualLightEvent`, and `CustomOverlayContentEvent`.
|
|
254
|
+
|
|
202
255
|
### OverlayListener types
|
|
203
256
|
|
|
204
257
|
| Value | Label |
|
|
@@ -210,7 +263,7 @@ Lumia auto-detects event subscriptions from literal `Overlay.on("event", ...)` c
|
|
|
210
263
|
| overlaycontent | Custom Overlay Content |
|
|
211
264
|
|
|
212
265
|
> 💡 Performance Tip: Only selected events are delivered to the overlay.
|
|
213
|
-
> 💡 The TypeScript types for
|
|
266
|
+
> 💡 The TypeScript types for chat, alerts, HFX, virtual lights, and overlay content are within the Types tab.
|
|
214
267
|
> 💡 `overlaycontent` sends custom content only to custom overlay layers with the matching `codeId`.
|
|
215
268
|
|
|
216
269
|
### Showing Toasts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Custom Overlays Examples
|
|
2
2
|
|
|
3
|
-
> Need to inspect what an alert returns? Open the [alert explorer](/docs/variables#alert-explorer) on the Platform Variables page to browse `data.alert`, `data.extraSettings.*`, and the fields available for each alert.
|
|
3
|
+
> Need to inspect what an alert returns? Open the [alert explorer](/docs/variables#alert-explorer) on the Platform Variables page to browse `data.alert`, `data.extraSettings.*`, and the fields available for each alert. For full `Overlay.on(...)` payload types, see [Overlay Type Definitions](/docs/custom-overlays/types).
|
|
4
4
|
|
|
5
5
|
## Index
|
|
6
6
|
|
|
@@ -48,6 +48,26 @@ export enum ConfigsFieldType {
|
|
|
48
48
|
*/
|
|
49
49
|
export type OverlayListener = 'chat' | 'alert' | 'hfx' | 'virtuallight' | 'overlaycontent';
|
|
50
50
|
|
|
51
|
+
export type ChatUserLevelKey = 'isSelf' | 'broadcaster' | 'mod' | 'vip' | 'tier3' | 'tier2' | 'subscriber' | 'regular' | 'follower' | 'anyone';
|
|
52
|
+
|
|
53
|
+
export type ChatUserLevels = Record<ChatUserLevelKey, boolean>;
|
|
54
|
+
|
|
55
|
+
export interface ChatReply {
|
|
56
|
+
/** Username of the message being replied to */
|
|
57
|
+
username: string;
|
|
58
|
+
/** Body of the message being replied to */
|
|
59
|
+
body: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ChatSharedMessage {
|
|
63
|
+
/** Avatar for the source user/channel of the shared message */
|
|
64
|
+
avatar: string;
|
|
65
|
+
/** Display name for the source user/channel of the shared message */
|
|
66
|
+
displayname: string;
|
|
67
|
+
/** User ID for the source user/channel of the shared message */
|
|
68
|
+
userId: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
51
71
|
/**
|
|
52
72
|
* Chat message event data structure.
|
|
53
73
|
* Fired when a chat message is received from any connected platform.
|
|
@@ -55,53 +75,50 @@ export type OverlayListener = 'chat' | 'alert' | 'hfx' | 'virtuallight' | 'overl
|
|
|
55
75
|
export interface ChatEvent {
|
|
56
76
|
/** Platform origin (e.g., "twitch", "kick", "youtube", "tiktok") */
|
|
57
77
|
origin: string;
|
|
58
|
-
/** Unique message identifier */
|
|
59
|
-
id
|
|
60
|
-
/** User's account username */
|
|
61
|
-
username
|
|
78
|
+
/** Unique message identifier when the platform provides one */
|
|
79
|
+
id?: string;
|
|
80
|
+
/** User's account username/login */
|
|
81
|
+
username?: string;
|
|
62
82
|
/** User's display name (may differ from username) */
|
|
63
|
-
displayname
|
|
83
|
+
displayname?: string;
|
|
64
84
|
/** Channel name where the message was sent */
|
|
65
|
-
channel
|
|
85
|
+
channel?: string;
|
|
66
86
|
/** URL to the user's avatar image */
|
|
67
|
-
avatar
|
|
87
|
+
avatar?: string | null;
|
|
68
88
|
/** The chat message content */
|
|
69
|
-
message
|
|
89
|
+
message?: string;
|
|
70
90
|
/** User's chat color as hex code (e.g., "#00FF7F") */
|
|
71
|
-
color
|
|
72
|
-
/**
|
|
73
|
-
badges
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
/** Raw
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
91
|
+
color?: string;
|
|
92
|
+
/** Badge identifiers or badge image URLs */
|
|
93
|
+
badges?: string[];
|
|
94
|
+
/** Lookup map used by some platforms to resolve badge identifiers to image URLs */
|
|
95
|
+
badgesLookup?: Record<string, string>;
|
|
96
|
+
/** Raw badge data string (e.g., "broadcaster/1,subscriber/12,vip/1") */
|
|
97
|
+
badgesRaw?: string;
|
|
98
|
+
/** Raw emotes data string from the platform */
|
|
99
|
+
emotesRaw?: string;
|
|
100
|
+
/** Emote pack data structure; shape varies by platform */
|
|
101
|
+
emotesPack?: Record<string, unknown>;
|
|
102
|
+
/** Whether the message contains a cheer/bits event */
|
|
103
|
+
isCheer?: boolean;
|
|
80
104
|
/** Reply data if this message is a reply to another */
|
|
81
|
-
reply
|
|
105
|
+
reply?: ChatReply | null;
|
|
106
|
+
/** Whether this is a Twitch Power-up message */
|
|
107
|
+
isPowerup?: boolean;
|
|
108
|
+
/** Twitch Power-up message type */
|
|
109
|
+
powerupType?: 'animated-message' | 'gigantified-emote-message' | string | false;
|
|
110
|
+
/** Twitch Power-up animation name */
|
|
111
|
+
powerupName?: 'simmer' | 'rainbow-eclipse' | 'cosmic-abyss' | string | false;
|
|
112
|
+
/** Shared chat source metadata when Twitch shared chat provides it */
|
|
113
|
+
sharedMessage?: ChatSharedMessage;
|
|
82
114
|
/** Lumia-specific user level identifiers */
|
|
83
|
-
lumiauserlevels
|
|
115
|
+
lumiauserlevels?: number[];
|
|
84
116
|
/** User permission levels and roles */
|
|
85
|
-
userLevels
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/** Whether the user is a VIP */
|
|
91
|
-
vip: boolean;
|
|
92
|
-
/** Whether the user is a tier 3 subscriber */
|
|
93
|
-
tier3: boolean;
|
|
94
|
-
/** Whether the user is a tier 2 subscriber */
|
|
95
|
-
tier2: boolean;
|
|
96
|
-
/** Whether the user is a subscriber (any tier) */
|
|
97
|
-
subscriber: boolean;
|
|
98
|
-
/** Whether the user is a regular viewer */
|
|
99
|
-
regular: boolean;
|
|
100
|
-
/** Whether the user is a follower */
|
|
101
|
-
follower: boolean;
|
|
102
|
-
/** Always true - indicates any user level */
|
|
103
|
-
anyone: boolean;
|
|
104
|
-
};
|
|
117
|
+
userLevels?: ChatUserLevels;
|
|
118
|
+
/** Local HH:mm:ss time string generated by Lumia */
|
|
119
|
+
time?: string;
|
|
120
|
+
/** Millisecond timestamp generated by Lumia */
|
|
121
|
+
timestamp?: number;
|
|
105
122
|
}
|
|
106
123
|
|
|
107
124
|
/**
|
|
@@ -558,6 +575,10 @@ export declare enum LumiaAlertValues {
|
|
|
558
575
|
YOUTUBE_SUPERSTICKER = "youtube-supersticker",
|
|
559
576
|
/** YouTube session superstickers */
|
|
560
577
|
YOUTUBE_SESSION_SUPERSTICKERS = "youtube-sessionSuperstickers",
|
|
578
|
+
/** YouTube gift event (jewel-based) */
|
|
579
|
+
YOUTUBE_GIFTS = "youtube-gifts",
|
|
580
|
+
/** YouTube session gifts */
|
|
581
|
+
YOUTUBE_SESSION_GIFTS = "youtube-sessionGifts",
|
|
561
582
|
/** YouTube total likes */
|
|
562
583
|
YOUTUBE_LIKE = "youtube-like",
|
|
563
584
|
/** YouTube total views */
|
|
@@ -1193,6 +1214,16 @@ export declare enum SystemVariables {
|
|
|
1193
1214
|
YOUTUBE_LAST_GIFT_MEMBER = "youtube_last_gift_member",
|
|
1194
1215
|
/** Session gift members (list). Use as {{youtube_session_gift_members}}. */
|
|
1195
1216
|
YOUTUBE_SESSION_GIFT_MEMBERS = "youtube_session_gift_members",
|
|
1217
|
+
/** Lifetime jewels count. Use as {{youtube_total_jewels_count}}. */
|
|
1218
|
+
YOUTUBE_TOTAL_JEWELS_COUNT = "youtube_total_jewels_count",
|
|
1219
|
+
/** Session jewels count. Use as {{youtube_session_jewels_count}}. */
|
|
1220
|
+
YOUTUBE_SESSION_JEWELS_COUNT = "youtube_session_jewels_count",
|
|
1221
|
+
/** Last jewel amount. Use as {{youtube_last_jewels}}. */
|
|
1222
|
+
YOUTUBE_LAST_JEWELS = "youtube_last_jewels",
|
|
1223
|
+
/** Last user that sent jewels. Use as {{youtube_last_jewels_user}}. */
|
|
1224
|
+
YOUTUBE_LAST_JEWELS_USER = "youtube_last_jewels_user",
|
|
1225
|
+
/** Session jewel gifters (list). Use as {{youtube_session_jewels_gifters}}. */
|
|
1226
|
+
YOUTUBE_SESSION_JEWELS_GIFTERS = "youtube_session_jewels_gifters",
|
|
1196
1227
|
/** Last subscriber. Use as {{youtube_last_subscriber}}. */
|
|
1197
1228
|
YOUTUBE_LAST_SUBSCRIBER = "youtube_last_subscriber",
|
|
1198
1229
|
/** Total uploaded videos. Use as {{youtube_total_video_count}}. */
|
|
@@ -52,6 +52,8 @@ In JS, wrap tokens in quotes: `const n = Number("{{twitch_session_bits_count}}")
|
|
|
52
52
|
|
|
53
53
|
Valid listener names: `chat`, `alert`, `hfx`, `virtuallight`, `overlaycontent`.
|
|
54
54
|
|
|
55
|
+
Full event payload shapes are in `custom-overlays.d.ts` and the Overlay Type Definitions page. Use `ChatEvent`, `AlertEvent`, `HfxEvent`, `VirtualLightEvent`, and `CustomOverlayContentEvent` there before guessing fields.
|
|
56
|
+
|
|
55
57
|
Alert rules:
|
|
56
58
|
|
|
57
59
|
- Branch on exact `data.alert` string equality. No `includes`, no `type`, no `platform` heuristics.
|
|
@@ -48,6 +48,26 @@ export enum ConfigsFieldType {
|
|
|
48
48
|
*/
|
|
49
49
|
export type OverlayListener = 'chat' | 'alert' | 'hfx' | 'virtuallight' | 'overlaycontent';
|
|
50
50
|
|
|
51
|
+
export type ChatUserLevelKey = 'isSelf' | 'broadcaster' | 'mod' | 'vip' | 'tier3' | 'tier2' | 'subscriber' | 'regular' | 'follower' | 'anyone';
|
|
52
|
+
|
|
53
|
+
export type ChatUserLevels = Record<ChatUserLevelKey, boolean>;
|
|
54
|
+
|
|
55
|
+
export interface ChatReply {
|
|
56
|
+
/** Username of the message being replied to */
|
|
57
|
+
username: string;
|
|
58
|
+
/** Body of the message being replied to */
|
|
59
|
+
body: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ChatSharedMessage {
|
|
63
|
+
/** Avatar for the source user/channel of the shared message */
|
|
64
|
+
avatar: string;
|
|
65
|
+
/** Display name for the source user/channel of the shared message */
|
|
66
|
+
displayname: string;
|
|
67
|
+
/** User ID for the source user/channel of the shared message */
|
|
68
|
+
userId: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
51
71
|
/**
|
|
52
72
|
* Chat message event data structure.
|
|
53
73
|
* Fired when a chat message is received from any connected platform.
|
|
@@ -55,53 +75,50 @@ export type OverlayListener = 'chat' | 'alert' | 'hfx' | 'virtuallight' | 'overl
|
|
|
55
75
|
export interface ChatEvent {
|
|
56
76
|
/** Platform origin (e.g., "twitch", "kick", "youtube", "tiktok") */
|
|
57
77
|
origin: string;
|
|
58
|
-
/** Unique message identifier */
|
|
59
|
-
id
|
|
60
|
-
/** User's account username */
|
|
61
|
-
username
|
|
78
|
+
/** Unique message identifier when the platform provides one */
|
|
79
|
+
id?: string;
|
|
80
|
+
/** User's account username/login */
|
|
81
|
+
username?: string;
|
|
62
82
|
/** User's display name (may differ from username) */
|
|
63
|
-
displayname
|
|
83
|
+
displayname?: string;
|
|
64
84
|
/** Channel name where the message was sent */
|
|
65
|
-
channel
|
|
85
|
+
channel?: string;
|
|
66
86
|
/** URL to the user's avatar image */
|
|
67
|
-
avatar
|
|
87
|
+
avatar?: string | null;
|
|
68
88
|
/** The chat message content */
|
|
69
|
-
message
|
|
89
|
+
message?: string;
|
|
70
90
|
/** User's chat color as hex code (e.g., "#00FF7F") */
|
|
71
|
-
color
|
|
72
|
-
/**
|
|
73
|
-
badges
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
/** Raw
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
91
|
+
color?: string;
|
|
92
|
+
/** Badge identifiers or badge image URLs */
|
|
93
|
+
badges?: string[];
|
|
94
|
+
/** Lookup map used by some platforms to resolve badge identifiers to image URLs */
|
|
95
|
+
badgesLookup?: Record<string, string>;
|
|
96
|
+
/** Raw badge data string (e.g., "broadcaster/1,subscriber/12,vip/1") */
|
|
97
|
+
badgesRaw?: string;
|
|
98
|
+
/** Raw emotes data string from the platform */
|
|
99
|
+
emotesRaw?: string;
|
|
100
|
+
/** Emote pack data structure; shape varies by platform */
|
|
101
|
+
emotesPack?: Record<string, unknown>;
|
|
102
|
+
/** Whether the message contains a cheer/bits event */
|
|
103
|
+
isCheer?: boolean;
|
|
80
104
|
/** Reply data if this message is a reply to another */
|
|
81
|
-
reply
|
|
105
|
+
reply?: ChatReply | null;
|
|
106
|
+
/** Whether this is a Twitch Power-up message */
|
|
107
|
+
isPowerup?: boolean;
|
|
108
|
+
/** Twitch Power-up message type */
|
|
109
|
+
powerupType?: 'animated-message' | 'gigantified-emote-message' | string | false;
|
|
110
|
+
/** Twitch Power-up animation name */
|
|
111
|
+
powerupName?: 'simmer' | 'rainbow-eclipse' | 'cosmic-abyss' | string | false;
|
|
112
|
+
/** Shared chat source metadata when Twitch shared chat provides it */
|
|
113
|
+
sharedMessage?: ChatSharedMessage;
|
|
82
114
|
/** Lumia-specific user level identifiers */
|
|
83
|
-
lumiauserlevels
|
|
115
|
+
lumiauserlevels?: number[];
|
|
84
116
|
/** User permission levels and roles */
|
|
85
|
-
userLevels
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/** Whether the user is a VIP */
|
|
91
|
-
vip: boolean;
|
|
92
|
-
/** Whether the user is a tier 3 subscriber */
|
|
93
|
-
tier3: boolean;
|
|
94
|
-
/** Whether the user is a tier 2 subscriber */
|
|
95
|
-
tier2: boolean;
|
|
96
|
-
/** Whether the user is a subscriber (any tier) */
|
|
97
|
-
subscriber: boolean;
|
|
98
|
-
/** Whether the user is a regular viewer */
|
|
99
|
-
regular: boolean;
|
|
100
|
-
/** Whether the user is a follower */
|
|
101
|
-
follower: boolean;
|
|
102
|
-
/** Always true - indicates any user level */
|
|
103
|
-
anyone: boolean;
|
|
104
|
-
};
|
|
117
|
+
userLevels?: ChatUserLevels;
|
|
118
|
+
/** Local HH:mm:ss time string generated by Lumia */
|
|
119
|
+
time?: string;
|
|
120
|
+
/** Millisecond timestamp generated by Lumia */
|
|
121
|
+
timestamp?: number;
|
|
105
122
|
}
|
|
106
123
|
|
|
107
124
|
/**
|
|
@@ -558,6 +575,10 @@ export declare enum LumiaAlertValues {
|
|
|
558
575
|
YOUTUBE_SUPERSTICKER = "youtube-supersticker",
|
|
559
576
|
/** YouTube session superstickers */
|
|
560
577
|
YOUTUBE_SESSION_SUPERSTICKERS = "youtube-sessionSuperstickers",
|
|
578
|
+
/** YouTube gift event (jewel-based) */
|
|
579
|
+
YOUTUBE_GIFTS = "youtube-gifts",
|
|
580
|
+
/** YouTube session gifts */
|
|
581
|
+
YOUTUBE_SESSION_GIFTS = "youtube-sessionGifts",
|
|
561
582
|
/** YouTube total likes */
|
|
562
583
|
YOUTUBE_LIKE = "youtube-like",
|
|
563
584
|
/** YouTube total views */
|
|
@@ -1193,6 +1214,16 @@ export declare enum SystemVariables {
|
|
|
1193
1214
|
YOUTUBE_LAST_GIFT_MEMBER = "youtube_last_gift_member",
|
|
1194
1215
|
/** Session gift members (list). Use as {{youtube_session_gift_members}}. */
|
|
1195
1216
|
YOUTUBE_SESSION_GIFT_MEMBERS = "youtube_session_gift_members",
|
|
1217
|
+
/** Lifetime jewels count. Use as {{youtube_total_jewels_count}}. */
|
|
1218
|
+
YOUTUBE_TOTAL_JEWELS_COUNT = "youtube_total_jewels_count",
|
|
1219
|
+
/** Session jewels count. Use as {{youtube_session_jewels_count}}. */
|
|
1220
|
+
YOUTUBE_SESSION_JEWELS_COUNT = "youtube_session_jewels_count",
|
|
1221
|
+
/** Last jewel amount. Use as {{youtube_last_jewels}}. */
|
|
1222
|
+
YOUTUBE_LAST_JEWELS = "youtube_last_jewels",
|
|
1223
|
+
/** Last user that sent jewels. Use as {{youtube_last_jewels_user}}. */
|
|
1224
|
+
YOUTUBE_LAST_JEWELS_USER = "youtube_last_jewels_user",
|
|
1225
|
+
/** Session jewel gifters (list). Use as {{youtube_session_jewels_gifters}}. */
|
|
1226
|
+
YOUTUBE_SESSION_JEWELS_GIFTERS = "youtube_session_jewels_gifters",
|
|
1196
1227
|
/** Last subscriber. Use as {{youtube_last_subscriber}}. */
|
|
1197
1228
|
YOUTUBE_LAST_SUBSCRIBER = "youtube_last_subscriber",
|
|
1198
1229
|
/** Total uploaded videos. Use as {{youtube_total_video_count}}. */
|
|
@@ -116,6 +116,7 @@ export declare const LumiaMapAlertTypeToEventListType: {
|
|
|
116
116
|
"youtube-subscriber": LumiaEventListTypes;
|
|
117
117
|
"youtube-superchat": LumiaEventListTypes;
|
|
118
118
|
"youtube-supersticker": LumiaEventListTypes;
|
|
119
|
+
"youtube-gifts": LumiaEventListTypes;
|
|
119
120
|
"youtube-like": LumiaEventListTypes;
|
|
120
121
|
"youtube-viewers": LumiaEventListTypes;
|
|
121
122
|
"crowdcontrol-effect": LumiaEventListTypes;
|
package/dist/eventlist.types.js
CHANGED
|
@@ -121,6 +121,7 @@ exports.LumiaMapAlertTypeToEventListType = {
|
|
|
121
121
|
[activity_types_1.LumiaAlertValues.YOUTUBE_SUBSCRIBER]: LumiaEventListTypes.FOLLOWER,
|
|
122
122
|
[activity_types_1.LumiaAlertValues.YOUTUBE_SUPERCHAT]: LumiaEventListTypes.SUPERCHATS,
|
|
123
123
|
[activity_types_1.LumiaAlertValues.YOUTUBE_SUPERSTICKER]: LumiaEventListTypes.SUPERSTICKERS,
|
|
124
|
+
[activity_types_1.LumiaAlertValues.YOUTUBE_GIFTS]: LumiaEventListTypes.GIFTS,
|
|
124
125
|
[activity_types_1.LumiaAlertValues.YOUTUBE_LIKE]: LumiaEventListTypes.LIKES,
|
|
125
126
|
[activity_types_1.LumiaAlertValues.YOUTUBE_VIEWERS]: LumiaEventListTypes.OTHERS,
|
|
126
127
|
[activity_types_1.LumiaAlertValues.CROWDCONTROL_EFFECT]: LumiaEventListTypes.OTHERS,
|
|
@@ -367,6 +367,16 @@ export declare enum SystemVariables {
|
|
|
367
367
|
YOUTUBE_LAST_GIFT_MEMBER = "youtube_last_gift_member",
|
|
368
368
|
/** Session gift members (list). Use as {{youtube_session_gift_members}}. */
|
|
369
369
|
YOUTUBE_SESSION_GIFT_MEMBERS = "youtube_session_gift_members",
|
|
370
|
+
/** Lifetime jewels count. Use as {{youtube_total_jewels_count}}. */
|
|
371
|
+
YOUTUBE_TOTAL_JEWELS_COUNT = "youtube_total_jewels_count",
|
|
372
|
+
/** Session jewels count. Use as {{youtube_session_jewels_count}}. */
|
|
373
|
+
YOUTUBE_SESSION_JEWELS_COUNT = "youtube_session_jewels_count",
|
|
374
|
+
/** Last jewel amount. Use as {{youtube_last_jewels}}. */
|
|
375
|
+
YOUTUBE_LAST_JEWELS = "youtube_last_jewels",
|
|
376
|
+
/** Last user that sent jewels. Use as {{youtube_last_jewels_user}}. */
|
|
377
|
+
YOUTUBE_LAST_JEWELS_USER = "youtube_last_jewels_user",
|
|
378
|
+
/** Session jewel gifters (list). Use as {{youtube_session_jewels_gifters}}. */
|
|
379
|
+
YOUTUBE_SESSION_JEWELS_GIFTERS = "youtube_session_jewels_gifters",
|
|
370
380
|
/** Last subscriber. Use as {{youtube_last_subscriber}}. */
|
|
371
381
|
YOUTUBE_LAST_SUBSCRIBER = "youtube_last_subscriber",
|
|
372
382
|
/** Total uploaded videos. Use as {{youtube_total_video_count}}. */
|
|
@@ -1039,6 +1049,8 @@ export declare const AllVariables: {
|
|
|
1039
1049
|
sessionMembers: string[];
|
|
1040
1050
|
giftMembers: string[];
|
|
1041
1051
|
sessionGiftMembers: string[];
|
|
1052
|
+
gifts: string[];
|
|
1053
|
+
sessionGifts: string[];
|
|
1042
1054
|
superchat: string[];
|
|
1043
1055
|
sessionSuperchats: string[];
|
|
1044
1056
|
supersticker: string[];
|
package/dist/variables.types.js
CHANGED
|
@@ -381,6 +381,16 @@ var SystemVariables;
|
|
|
381
381
|
SystemVariables["YOUTUBE_LAST_GIFT_MEMBER"] = "youtube_last_gift_member";
|
|
382
382
|
/** Session gift members (list). Use as {{youtube_session_gift_members}}. */
|
|
383
383
|
SystemVariables["YOUTUBE_SESSION_GIFT_MEMBERS"] = "youtube_session_gift_members";
|
|
384
|
+
/** Lifetime jewels count. Use as {{youtube_total_jewels_count}}. */
|
|
385
|
+
SystemVariables["YOUTUBE_TOTAL_JEWELS_COUNT"] = "youtube_total_jewels_count";
|
|
386
|
+
/** Session jewels count. Use as {{youtube_session_jewels_count}}. */
|
|
387
|
+
SystemVariables["YOUTUBE_SESSION_JEWELS_COUNT"] = "youtube_session_jewels_count";
|
|
388
|
+
/** Last jewel amount. Use as {{youtube_last_jewels}}. */
|
|
389
|
+
SystemVariables["YOUTUBE_LAST_JEWELS"] = "youtube_last_jewels";
|
|
390
|
+
/** Last user that sent jewels. Use as {{youtube_last_jewels_user}}. */
|
|
391
|
+
SystemVariables["YOUTUBE_LAST_JEWELS_USER"] = "youtube_last_jewels_user";
|
|
392
|
+
/** Session jewel gifters (list). Use as {{youtube_session_jewels_gifters}}. */
|
|
393
|
+
SystemVariables["YOUTUBE_SESSION_JEWELS_GIFTERS"] = "youtube_session_jewels_gifters";
|
|
384
394
|
/** Last subscriber. Use as {{youtube_last_subscriber}}. */
|
|
385
395
|
SystemVariables["YOUTUBE_LAST_SUBSCRIBER"] = "youtube_last_subscriber";
|
|
386
396
|
/** Total uploaded videos. Use as {{youtube_total_video_count}}. */
|
|
@@ -2011,6 +2021,11 @@ exports.AllVariables = {
|
|
|
2011
2021
|
'youtube_session_gift_members_count',
|
|
2012
2022
|
'youtube_last_gift_member',
|
|
2013
2023
|
'youtube_session_gift_members',
|
|
2024
|
+
'youtube_total_jewels_count',
|
|
2025
|
+
'youtube_session_jewels_count',
|
|
2026
|
+
'youtube_last_jewels',
|
|
2027
|
+
'youtube_last_jewels_user',
|
|
2028
|
+
'youtube_session_jewels_gifters',
|
|
2014
2029
|
'youtube_total_video_count',
|
|
2015
2030
|
'youtube_total_view_count',
|
|
2016
2031
|
],
|
|
@@ -2040,6 +2055,22 @@ exports.AllVariables = {
|
|
|
2040
2055
|
'subPlanName',
|
|
2041
2056
|
],
|
|
2042
2057
|
sessionGiftMembers: ['total', 'previousTotal'],
|
|
2058
|
+
gifts: [
|
|
2059
|
+
'username',
|
|
2060
|
+
'displayname',
|
|
2061
|
+
'avatar',
|
|
2062
|
+
'userId',
|
|
2063
|
+
'jewelsAmount',
|
|
2064
|
+
'totalJewels',
|
|
2065
|
+
'comboCount',
|
|
2066
|
+
'giftName',
|
|
2067
|
+
'giftUrl',
|
|
2068
|
+
'hasVisualEffect',
|
|
2069
|
+
'altText',
|
|
2070
|
+
'language',
|
|
2071
|
+
'message',
|
|
2072
|
+
],
|
|
2073
|
+
sessionGifts: ['total', 'previousTotal'],
|
|
2043
2074
|
superchat: ['username', 'displayname', 'currency', 'currencySymbol', 'amount', 'message'],
|
|
2044
2075
|
sessionSuperchats: ['total', 'previousTotal', 'currency', 'currencySymbol'],
|
|
2045
2076
|
supersticker: ['username', 'displayname', 'stickerId', 'stickerName', 'amount', 'currency', 'currencySymbol', 'imageUrl'],
|