@tixyel/streamelements 6.5.1 → 7.0.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/index.d.ts CHANGED
@@ -7,144 +7,199 @@
7
7
  import { ComfyJSInstance, OnErrorHandler, OnCommandHandler, OnChatHandler, OnWhisperHandler, OnMessageDeletedHandler, OnJoinHandler, OnPartHandler, OnHostedHandler, OnRaidHandler, OnSubHandler, OnResubHandler, OnSubGiftHandler, OnSubMysteryGiftHandler, OnGiftSubContinueHandler, OnCheerHandler, OnChatModeHandler, OnRewardHandler, OnConnectedHandler, OnReconnectHandler } from 'comfy.js';
8
8
  export { ComfyJSInstance } from 'comfy.js';
9
9
 
10
- declare namespace YoutubeEvents {
11
- namespace Message {
12
- export type Data = {
13
- listener: 'message';
14
- event: Event;
15
- };
16
- export type Event = {
17
- service: 'youtube';
18
- data: {
19
- kind: string;
20
- etag: string;
21
- id: string;
22
- snippet: {
23
- type: string;
24
- liveChatId: string;
25
- authorChannelId: string;
26
- publishedAt: string;
27
- hasDisplayContent: boolean;
28
- displayMessage: string;
29
- textMessageDetails: {
30
- messageText: string;
31
- };
32
- };
33
- authorDetails: {
34
- channelId: string;
35
- channelUrl: string;
36
- displayName: string;
37
- profileImageUrl: string;
38
- isVerified: boolean;
39
- isChatOwner: boolean;
40
- isChatSponsor: boolean;
41
- isChatModerator: boolean;
42
- };
43
- msgId: string;
44
- userId: string;
45
- nick: string;
46
- badges: Array<Badges>;
47
- displayName: string;
48
- isAction: boolean;
49
- time: number;
50
- tags: Array<Tags>;
51
- displayColor: string | null;
52
- channel: string;
53
- text: string;
54
- avatar: string;
55
- emotes: Array<Emotes>;
56
- };
57
- renderedText: string;
58
- };
59
- type Badges = {};
60
- type Tags = {};
61
- type Emotes = {};
62
- export {};
63
- }
64
- namespace Superchat {
10
+ type Provider$1 = 'twitch' | 'youtube' | 'kick' | 'facebook' | 'streamelements';
11
+ type ClientEvents$1 = {
12
+ provider: 'streamelements';
13
+ data: StreamElements.Event.Provider.StreamElements.Events;
14
+ } | {
15
+ provider: 'twitch';
16
+ data: StreamElements.Event.Provider.Twitch.Events;
17
+ } | {
18
+ provider: 'youtube';
19
+ data: StreamElements.Event.Provider.YouTube.Events;
20
+ } | {
21
+ provider: 'kick';
22
+ data: StreamElements.Event.Provider.Kick.Events;
23
+ } | {
24
+ provider: 'facebook';
25
+ data: StreamElements.Event.Provider.Facebook.Events;
26
+ };
27
+
28
+ declare namespace StreamElementsEvents {
29
+ namespace Tip {
65
30
  type Data = {
66
- listener: 'superchat-latest';
31
+ listener: 'tip-latest';
67
32
  event: Event;
68
33
  };
69
34
  type Event = {
70
35
  amount: number;
71
36
  avatar: string;
37
+ name: string;
72
38
  displayName: string;
73
39
  providerId: string;
74
- name: string;
75
40
  _id: string;
76
41
  sessionTop: boolean;
77
- type: 'superchat';
78
- originalEventName: 'superchat-latest';
42
+ type: 'tip';
43
+ originalEventName: 'tip-latest';
79
44
  };
80
45
  }
81
- namespace Subscriber {
46
+ namespace KVStore {
82
47
  type Data = {
83
- listener: 'subscriber-latest';
48
+ listener: 'kvstore:update';
84
49
  event: Event;
85
50
  };
86
51
  type Event = {
87
- avatar: string;
88
- displayName: string;
89
- providerId: string;
90
- name: string;
91
- _id: string;
92
- sessionTop: boolean;
93
- type: 'subscriber';
94
- originalEventName: 'subscriber-latest';
52
+ data: {
53
+ key: `customWidget.${string}`;
54
+ value: string | number | boolean | Record<string, any>;
55
+ };
95
56
  };
96
57
  }
97
- namespace Sponsor {
58
+ namespace BotCounter {
98
59
  type Data = {
99
- listener: 'sponsor-latest';
60
+ listener: 'bot:counter';
100
61
  event: Event;
101
62
  };
102
- type Event = common & (normal | gift | community | spam);
103
- type common = {
104
- amount: number;
63
+ type Event = {
64
+ counter: string;
65
+ value: number;
66
+ };
67
+ }
68
+ namespace AlertService {
69
+ type Data = {
70
+ listener: 'alertService:toggleSound';
71
+ event: Event;
72
+ };
73
+ type Event = {
74
+ muted: boolean;
75
+ };
76
+ }
77
+ namespace EventSkip {
78
+ type Data = {
79
+ listener: 'event:skip';
80
+ event: Event;
81
+ };
82
+ type Event = {};
83
+ }
84
+ namespace EventTest {
85
+ export type Data = {
86
+ listener: 'event:test';
87
+ event: Event;
88
+ };
89
+ export type Event = widgetButton | emulatedEvents<EventType> | Session;
90
+ type items = {
105
91
  name: string;
106
- displayName: string;
107
- message?: string;
108
- providerId?: string;
109
- avatar?: string;
110
- sender?: string;
111
- gifted?: boolean;
112
- bulkGifted?: boolean;
113
- isCommunityGift?: boolean;
114
- _id?: string;
115
- sessionTop?: boolean;
116
- playedAsCommunityGift?: boolean;
117
- type: 'sponsor';
118
- originalEventName: 'sponsor-latest';
92
+ price: number;
93
+ quantity: number;
119
94
  };
120
- type normal = {
121
- sender?: undefined;
122
- gifted?: false;
123
- bulkGifted?: false;
124
- isCommunityGift?: false;
95
+ type widgetButton = {
96
+ listener: 'widget-button';
97
+ field: string;
98
+ value: string | number | boolean;
125
99
  };
126
- type gift = {
127
- sender: string;
128
- gifted: true;
129
- bulkGifted?: false;
130
- isCommunityGift?: false;
100
+ type EventType = 'follower' | 'subscriber' | 'tip' | 'cheer' | 'raid';
101
+ type EventTier = 'prime' | '1000' | '2000' | '3000';
102
+ type emulatedEvents<T extends EventType> = {
103
+ listener: `${T}-latest`;
104
+ event: {
105
+ type: T;
106
+ name: string;
107
+ amount: number;
108
+ count: number;
109
+ message?: string;
110
+ gifted?: boolean;
111
+ bulkGifted?: boolean;
112
+ sender?: string;
113
+ subExtension?: boolean;
114
+ items: items[];
115
+ tier: EventTier;
116
+ month: string;
117
+ isTest: true;
118
+ };
131
119
  };
132
- type community = {
133
- message: string;
134
- sender: string;
135
- gifted?: false;
136
- bulkGifted: true;
137
- isCommunityGift?: false;
120
+ type Session = SessionCount | SessionTotal | SessionTop | SessionGoal | SessionRecent | SessionPoints;
121
+ type SessionCount = {
122
+ listener: `${EventType}-count`;
123
+ event: {
124
+ type: EventType;
125
+ name: string;
126
+ count: number;
127
+ items: items[];
128
+ tier: EventTier;
129
+ month: string;
130
+ isTest: true;
131
+ };
138
132
  };
139
- type spam = {
140
- sender: string;
141
- gifted: true;
142
- bulkGifted?: false;
143
- isCommunityGift: true;
133
+ type SessionTotal = {
134
+ listener: `${EventType}-total`;
135
+ event: {
136
+ type: EventType;
137
+ name: string;
138
+ amount: number;
139
+ count: number;
140
+ items: items[];
141
+ tier: EventTier;
142
+ month: string;
143
+ isTest: true;
144
+ };
145
+ };
146
+ type SessionTop = {
147
+ listener: `${EventType}-top`;
148
+ event: {
149
+ type: EventType;
150
+ name: string;
151
+ amount: number;
152
+ count: number;
153
+ items: items[];
154
+ tier: EventTier;
155
+ month: string;
156
+ isTest: true;
157
+ };
158
+ };
159
+ type SessionGoal = {
160
+ listener: `${EventType}-goal`;
161
+ event: {
162
+ type: EventType;
163
+ name: string;
164
+ amount: number;
165
+ count: number;
166
+ items: items[];
167
+ tier: EventTier;
168
+ month: string;
169
+ isTest: true;
170
+ };
144
171
  };
172
+ type SessionRecent = {
173
+ listener: `${EventType}-recent`;
174
+ event: {
175
+ event: SessionRecentEvent[];
176
+ };
177
+ };
178
+ type SessionRecentEvent = {
179
+ type: EventType;
180
+ name: string;
181
+ amount: number;
182
+ count: number;
183
+ tier: EventTier;
184
+ isTest: true;
185
+ };
186
+ type SessionPoints = {
187
+ listener: `${EventType}-points`;
188
+ event: {
189
+ type: EventType;
190
+ name: string;
191
+ amount: number;
192
+ count: number;
193
+ items: items[];
194
+ tier: EventTier;
195
+ month: string;
196
+ isTest: true;
197
+ };
198
+ };
199
+ export {};
145
200
  }
146
201
  interface BaseEvent {
147
- provider: 'youtube';
202
+ provider: Provider$1;
148
203
  flagged: boolean;
149
204
  channel: string;
150
205
  createdAt: string;
@@ -160,60 +215,14 @@ declare namespace YoutubeEvents {
160
215
  listener: 'event';
161
216
  event: Event;
162
217
  };
163
- type Event = Superchat | Subscriber | Sponsor | CommunityGiftedSponsor;
164
- interface Superchat extends BaseEvent {
165
- type: 'superchat';
166
- data: {
167
- amount: string;
168
- username: string;
169
- message: string;
170
- avatar: string;
171
- providerId: string;
172
- };
173
- }
174
- interface Subscriber extends BaseEvent {
175
- type: 'subscriber';
176
- data: {
177
- avatar: string;
178
- displayName: string;
179
- username: string;
180
- providerId: string;
181
- };
182
- }
183
- interface Sponsor extends BaseEvent {
184
- type: 'sponsor';
185
- data: FirstTimeSponsor | Resubscribe | GiftedSponsor;
186
- }
187
- type FirstTimeSponsor = {
188
- amount: number;
189
- username: string;
190
- displayName: string;
191
- providerId: string;
192
- avatar: string;
193
- };
194
- type Resubscribe = {
195
- amount: number;
196
- username: string;
197
- displayName: string;
198
- providerId: string;
199
- avatar: string;
200
- };
201
- type GiftedSponsor = {
202
- amount: number;
203
- username: string;
204
- displayName: string;
205
- providerId: string;
206
- sender: string;
207
- gifted: true;
208
- avatar: string;
209
- };
210
- interface CommunityGiftedSponsor extends BaseEvent {
211
- type: 'communityGiftPurchase';
218
+ type Event = Tip;
219
+ interface Tip extends BaseEvent {
220
+ type: 'tip';
212
221
  data: {
213
- amount: number;
222
+ amount: string;
223
+ currency: string;
214
224
  username: string;
215
- displayName: string;
216
- providerId: string;
225
+ message: string;
217
226
  avatar: string;
218
227
  };
219
228
  }
@@ -233,6 +242,20 @@ type TwitchEmote = {
233
242
  start: number;
234
243
  end: number;
235
244
  };
245
+ type FfzEmote = {
246
+ type: 'ffz';
247
+ id: string;
248
+ name: string;
249
+ gif: boolean;
250
+ animated: boolean;
251
+ urls: {
252
+ '1': string;
253
+ '2': string;
254
+ '4': string;
255
+ };
256
+ start: number;
257
+ end: number;
258
+ };
236
259
  type SeventvEmote = {
237
260
  type: '7tv';
238
261
  name: string;
@@ -247,10 +270,6 @@ type SeventvEmote = {
247
270
  };
248
271
  start: number;
249
272
  end: number;
250
- cords: {
251
- x: number;
252
- y: number;
253
- };
254
273
  };
255
274
  type BttvEmote = {
256
275
  type: 'bttv';
@@ -265,12 +284,6 @@ type BttvEmote = {
265
284
  };
266
285
  start: number;
267
286
  end: number;
268
- coords: {
269
- x: number;
270
- y: number;
271
- width: number;
272
- height: number;
273
- };
274
287
  };
275
288
  type Emoji = {
276
289
  type: 'emoji';
@@ -281,9 +294,10 @@ type Emoji = {
281
294
  '1': string;
282
295
  };
283
296
  };
284
- type Emote = TwitchEmote | BttvEmote | SeventvEmote | Emoji;
297
+ type Emote = TwitchEmote | BttvEmote | SeventvEmote | FfzEmote | Emoji;
285
298
 
286
299
  type PathValue<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? PathValue<T[K], Rest> : never : P extends keyof T ? T[P] : never;
300
+ type NumberAsString = string;
287
301
  type MapNumberValuesToString<T> = {
288
302
  [K in keyof T]: T[K] extends number ? `${T[K]}` | ReturnType<T[K]['toString']> : T[K];
289
303
  };
@@ -298,7 +312,7 @@ declare namespace Twitch {
298
312
  * 'subscriber/25'
299
313
  * ```
300
314
  */
301
- 'badge-info': String;
315
+ 'badge-info': string;
302
316
  /**
303
317
  * Comma-separated list of chat badges in the form, <badge>/<version>. For example admin/1. There are many possible badge values, but here are few: admin, bits, broadcaster, moderator, subscriber, staff, turbo
304
318
  * Most badges have only 1 version, but some badges like subscriber badges offer different versions of the badge depending on how long the user has subscribed.
@@ -307,7 +321,7 @@ declare namespace Twitch {
307
321
  * 'staff/1,bits/1000,partner/1'
308
322
  * ```
309
323
  */
310
- 'badges': String;
324
+ badges: string;
311
325
  /**
312
326
  * The color of the user's name in the chat.
313
327
  * @example
@@ -315,7 +329,7 @@ declare namespace Twitch {
315
329
  * '#FF0000'
316
330
  * ```
317
331
  */
318
- 'color': string | undefined;
332
+ color: string | undefined;
319
333
  /**
320
334
  * The user’s display name, escaped as described in the [IRCv3 spec](https://ircv3.net/specs/extensions/message-tags.html). This tag may be empty if it is never set.
321
335
  * @example
@@ -323,11 +337,11 @@ declare namespace Twitch {
323
337
  * 'TwitchUser'
324
338
  * ```
325
339
  */
326
- 'display-name': String;
340
+ 'display-name': string;
327
341
  /**
328
342
  * A comma-delimited list of IDs that identify the emote sets that the user has access to. Is always set to at least zero (0).
329
343
  */
330
- 'emote-sets': String;
344
+ 'emote-sets': string;
331
345
  /**
332
346
  * A slash-delimited list of emotes and their positions in the message. Each emote is in the form, `<emote ID>:<ranges>`, where ranges are comma-delimited pairs of indices in the form `<start position>-<end position>`. The position indices are zero-based.
333
347
  * NOTE: It’s possible for a message to begin with with `\001ACTION` when /me is used by a user in chat. In these cases emote positions should be considered to begin after `001ACTION `, which includes its succeeding whitespace.
@@ -336,12 +350,12 @@ declare namespace Twitch {
336
350
  * '25:0-4,12-16/1902:6-10'
337
351
  * ```
338
352
  */
339
- 'emotes': String;
340
- 'flags': String;
353
+ emotes: string;
354
+ flags: string;
341
355
  /**
342
356
  * A Boolean value that indicates whether the user has site-wide commercial free mode enabled. Is true (1) if enabled; otherwise, false (0).
343
357
  */
344
- 'turbo': 0 | 1;
358
+ turbo: 0 | 1;
345
359
  /**
346
360
  * The User ID of the relevant user.
347
361
  * @example
@@ -349,25 +363,26 @@ declare namespace Twitch {
349
363
  * '1337'
350
364
  * ```
351
365
  */
352
- 'user-id': String;
366
+ 'user-id': string;
353
367
  /**
354
368
  * The type of user. Possible values are:
355
369
  * ```
356
370
  * • "" - A normal user
371
+ * • mod - A channel moderator
357
372
  * • admin - A Twitch administrator
358
373
  * • global_mod - A global moderator
359
374
  * • staff - A Twitch employee
360
375
  * ```
361
376
  */
362
- 'user-type': '' | 'admin' | 'global_mod' | 'staff';
377
+ 'user-type': '' | 'mod' | 'admin' | 'global_mod' | 'staff';
363
378
  /**
364
379
  * The amount of Bits the user cheered. Only a Bits cheer message includes this tag.
365
380
  */
366
- 'bits': number;
381
+ bits: number;
367
382
  /**
368
383
  * A Boolean value that determines whether the user is a moderator. Is true (1) if the user is a moderator; otherwise, false (0).
369
384
  */
370
- 'mod': 0 | 1;
385
+ mod: 0 | 1;
371
386
  /**
372
387
  * The ID of the message. In UUID format.
373
388
  */
@@ -403,19 +418,19 @@ declare namespace Twitch {
403
418
  /**
404
419
  * An ID that identifies the chat room (channel).
405
420
  */
406
- 'room-id': String;
421
+ 'room-id': string;
407
422
  /**
408
423
  * Comma-separated list of chat badges for the chatter in the room the message was sent from. This uses the same format as the `badges` tag.
409
424
  */
410
- 'source-badges': String;
425
+ 'source-badges': string;
411
426
  /**
412
427
  * Contains metadata related to the chat badges in the source-badges tag.
413
428
  */
414
- 'source-badge-info': String;
429
+ 'source-badge-info': string;
415
430
  /**
416
431
  * A UUID that identifies the source message from the channel the message was sent from.
417
432
  */
418
- 'source-id': String;
433
+ 'source-id': string;
419
434
  /**
420
435
  * A Boolean that indicates if a message sent during a shared chat session is only sent to the source channel. Has no effect if the message is not sent during a shared chat session.
421
436
  */
@@ -423,11 +438,11 @@ declare namespace Twitch {
423
438
  /**
424
439
  * An ID that identifies the chat room (channel) the message was sent from.
425
440
  */
426
- 'source-room-id': String;
441
+ 'source-room-id': string;
427
442
  /**
428
443
  * A Boolean value that determines whether the user is a subscriber. Is true (1) if the user is a subscriber; otherwise, false (0).
429
444
  */
430
- 'subscriber': 0 | 1;
445
+ subscriber: 0 | 1;
431
446
  /**
432
447
  * The UNIX timestamp.
433
448
  */
@@ -435,7 +450,18 @@ declare namespace Twitch {
435
450
  /**
436
451
  * A Boolean value that determines whether the user that sent the chat is a VIP. The message includes this tag if the user is a VIP; otherwise, the message doesn’t include this tag (check for the presence of the tag instead of whether the tag is set to true or false).
437
452
  */
438
- 'vip': undefined | '';
453
+ vip: undefined | '';
454
+ };
455
+ type Reply = {
456
+ msgId: string;
457
+ userId: string;
458
+ userLogin: string;
459
+ displayName: string;
460
+ msgBody: string;
461
+ };
462
+ type Thread = {
463
+ parentMsgId: string;
464
+ parentUserLogin: string;
439
465
  };
440
466
  type badge = {
441
467
  type: string;
@@ -443,7 +469,20 @@ declare namespace Twitch {
443
469
  url: string;
444
470
  description: string;
445
471
  };
446
- type roles = '100 bits' | 'no audio' | 'no video' | 'bot' | 'twitch staff' | 'admins' | 'artist' | 'game developer' | 'prime' | 'turbo' | 'subscriber' | 'broadcaster' | 'verified' | 'moderator' | 'vip';
472
+ type GlobalBadge = {
473
+ set_id: tags;
474
+ versions: Array<{
475
+ id: string;
476
+ image_url_1x: string;
477
+ image_url_2x: string;
478
+ image_url_4x: string;
479
+ title: string;
480
+ description: string;
481
+ click_action: string | null;
482
+ click_url: string | null;
483
+ }>;
484
+ };
485
+ type tags = 'qsmp2' | 'jasontheween-7-day-survival' | 'support-a-streamer-ho26-badge' | 'twitch-recap-2025' | 'ugly-sweater' | 'fright-fest-2025' | 'gamerduo' | 'video-games-day' | 'twitch-intern-2022' | 'touch-grass' | 'twitchcon-referral-program-2025-chrome-star' | 'twitchcon-referral-program-2025-bleedpurple' | 'share-the-love' | 'gone-bananas' | 'twitchcon-2025---rotterdam' | 'clip-the-halls' | 'twitch-recap-2024' | 'subtember-2024' | 'twitch-intern-2024' | 'twitch-dj' | 'destiny-2-the-final-shape-streamer' | 'destiny-2-final-shape-raid-race' | 'twitchcon-2024---san-diego' | 'minecraft-15th-anniversary-celebration' | 'warcraft' | 'vip' | 'vga-champ-2017' | 'tyranny_1' | 'twitchconNA2023' | 'twitchconNA2020' | 'twitchconNA2022' | 'twitchconNA2019' | 'twitchconEU2023' | 'twitchconEU2022' | 'twitchcon2018' | 'twitchconAmsterdam2020' | 'twitchconEU2019' | 'twitchbot' | 'twitchcon2017' | 'twitchcon-2024---rotterdam' | 'twitch-recap-2023' | 'twitch-intern-2023' | 'treasure-adventure-world_1' | 'titan-souls_1' | 'this-war-of-mine_1' | 'the-surge_2' | 'the-surge_1' | 'the-surge_3' | 'the-golden-predictor-of-the-game-awards-2023' | 'the-game-awards-2023' | 'superhot_1' | 'strafe_1' | 'streamer-awards-2024' | 'starbound_1' | 'staff' | 'samusoffer_beta' | 'rplace-2023' | 'rift_1' | 'raiden-v-directors-cut_1' | 'psychonauts_1' | 'premium' | 'overwatch-league-insider_2019B' | 'partner' | 'overwatch-league-insider_2019A' | 'okhlos_1' | 'overwatch-league-insider_2018B' | 'overwatch-league-insider_1' | 'kingdom-new-lands_1' | 'jackbox-party-pack_1' | 'innerspace_2' | 'innerspace_1' | 'hype-train' | 'hello_neighbor_1' | 'gold-pixel-heart' | 'heavy-bullets_1' | 'glitchcon2020' | 'glhf-pledge' | 'getting-over-it_2' | 'getting-over-it_1' | 'frozen-synapse_1' | 'founder' | 'frozen-cortext_1' | 'firewatch_1' | 'enter-the-gungeon_1' | 'duelyst_5' | 'duelyst_6' | 'duelyst_7' | 'duelyst_2' | 'duelyst_4' | 'duelyst_3' | 'duelyst_1' | 'devilian_1' | 'devil-may-cry-hd_4' | 'devil-may-cry-hd_3' | 'devil-may-cry-hd_2' | 'devil-may-cry-hd_1' | 'deceit_1' | 'darkest-dungeon_1' | 'cuphead_1' | 'clip-champ' | 'broken-age_1' | 'bubsy-the-woolies_1' | 'bits-leader' | 'brawlhalla_1' | 'bits' | 'bits-charity' | 'battlechefbrigade_3' | 'battlerite_1' | 'battlechefbrigade_2' | 'battlechefbrigade_1' | 'axiom-verge_1' | 'anomaly-2_1' | 'anomaly-warzone-earth_1' | 'ambassador' | 'H1Z1_1' | '60-seconds_3' | '60-seconds_2' | '60-seconds_1' | '1979-revolution_1' | '10-years-as-twitch-staff' | '15-years-as-twitch-staff' | '5-years-as-twitch-staff' | 'aang' | 'admin' | 'alone' | 'anonymous-cheerer' | 'arc-raiders-launch-2025' | 'arcane-season-2-premiere' | 'artist-badge' | 'battlefield-6' | 'bingbonglove' | 'black-ops-7-global-launch' | 'borderlands-4-badge---ripper' | 'borderlands-4-badge---vault-symbol' | 'bot-badge' | 'broadcaster' | 'bungie-foundation-ally' | 'bungie-foundation-supporter' | 'chatter-cs-go-2022' | 'clips-leader' | 'creator-cs-go-2022' | 'crimson-butterfly' | 'diablo-30th-anniversary' | 'diana' | 'ditto' | 'dragonscimmy' | 'dreamcon-2024' | 'elden-ring-recluse' | 'elden-ring-wylder' | 'eso_1' | 'evo-2025' | 'extension' | 'fallout-season-2-ghoul' | 'first-stand-2026-supporter' | 'first-stand-2026-viewer' | 'fischer' | 'frog-lantern' | 'game-developer' | 'gears-of-war-superfan-badge' | 'gingko-leaf' | 'global_mod' | 'gold-pixel-heart---together-for-good-24' | 'gp-explorer-3' | 'hornet' | 'hunt-crosses' | 'hypershot-celestial' | 'jeff-the-land-shark' | 'k4sen-con-2025' | 'kodama' | 'la-velada-iv' | 'la-velada-v-badge' | 'lamby' | 'lead_moderator' | 'league-of-legends-mid-season-invitational-2025---grey' | 'league-of-legends-mid-season-invitational-2025---purple' | 'legendus' | 'lol-worlds-2025' | 'lost-ark-anniversary' | 'low' | 'marathon-reveal-runner' | 'marathon-silkworm' | 'marathon-sub-burger' | 'mel' | 'moderator' | 'moments' | 'mr-raccoon' | 'never-grave---witch-hat' | 'no_audio' | 'no_video' | 'path-of-exile-2-badge' | 'pokemon-30th-anniversary' | 'pokemon-legends-z-a-chikorita' | 'pokemon-legends-z-a-tepig' | 'pokemon-legends-z-a-totodile' | 'power-rangers' | 'predictions' | 'purple-noob' | 'purple-pixel-heart---together-for-good-24' | 'raging-wolf-helm' | 'raider-icon-badge' | 'rainbow-six-siege-x-10th-anniversary' | 'revedtv-stream-awards-2025' | 'ruby-pixel-heart---together-for-good-24' | 'rudy' | 'rustmas-2025' | 'sajam-slam-badge' | 'scampuss' | 'seeks-eye' | 'social-sharing' | 'sonic-racing-crossworlds' | 'speedons-5-badge' | 'stream-for-humanity-2-2025' | 'streamer-awards-tux' | 'sub-gift-leader' | 'sub-gifter' | 'subscriber' | 'subtember-2025' | 'superultracombo-2023' | 'survival-cup-4' | 'tft-paris-open' | 'the-deer' | 'the-first-descendant-badge' | 'the-man-without-fear' | 'the-onryos-mask' | 'together-for-good-25---good-badge' | 'together-for-good-25---gooder-badge' | 'together-for-good-25---goodest-badge' | 'together-for-good-25---wicked-dub-badge' | 'total-war-anniversary' | 'toxic-zombie' | 'turbo' | 'twitchcon-2026-europe-row-houses' | 'twitchcon-2026-europe-windmill' | 'umbrella-corporation' | 'user-anniversary' | 'vct-paris-2025' | 'yellow-noob' | 'zevent-2024' | 'zevent25';
447
486
  }
448
487
 
449
488
  declare namespace TwitchEvents {
@@ -457,11 +496,23 @@ declare namespace TwitchEvents {
457
496
  data: {
458
497
  time: number;
459
498
  tags: Partial<MapNumberValuesToString<Twitch.IRC>> & {
499
+ 'badge-info': string;
500
+ 'badges': string;
460
501
  'client-nonce': string;
502
+ 'color': string;
503
+ 'display-name': string;
504
+ 'emotes': string;
505
+ 'first-msg': '1' | '0';
461
506
  'flags': string;
462
507
  'id': string;
463
- 'first-msg': '1' | '0';
508
+ 'mod': '1' | '0';
464
509
  'returning-chatter': '1' | '0';
510
+ 'room-id': string;
511
+ 'subscriber': '1' | '0';
512
+ 'tmi-sent-ts': string;
513
+ 'turbo': '1' | '0';
514
+ 'user-id': string;
515
+ 'user-type': '' | 'mod' | 'admin' | 'global_mod' | 'staff';
465
516
  };
466
517
  nick: string;
467
518
  displayName: string;
@@ -640,35 +691,257 @@ declare namespace TwitchEvents {
640
691
  type: 'follower';
641
692
  data: {
642
693
  username: string;
643
- displayName: string;
644
- providerId: string;
645
- quantity: number;
694
+ displayName: string;
695
+ providerId: string;
696
+ quantity: number;
697
+ avatar: string;
698
+ };
699
+ }
700
+ interface Cheer extends BaseEvent {
701
+ type: 'cheer';
702
+ data: {
703
+ amount: number;
704
+ username: string;
705
+ displayName: string;
706
+ providerId: string;
707
+ message: string;
708
+ quantity: number;
709
+ avatar: string;
710
+ };
711
+ }
712
+ interface Subscriber extends BaseEvent {
713
+ type: 'subscriber';
714
+ data: FirstTimeSubscriber | Resubscribe | GiftedSubscriber | CommunityGiftedSubscriber;
715
+ }
716
+ type FirstTimeSubscriber = {
717
+ amount: number;
718
+ username: string;
719
+ displayName: string;
720
+ providerId: string;
721
+ tier: Subscriber.SubscriberTier;
722
+ quantity: 0;
723
+ avatar: string;
724
+ };
725
+ type Resubscribe = {
726
+ amount: number;
727
+ username: string;
728
+ displayName: string;
729
+ providerId: string;
730
+ message: string;
731
+ tier: Subscriber.SubscriberTier;
732
+ streak: number;
733
+ quantity: number;
734
+ avatar: string;
735
+ };
736
+ type GiftedSubscriber = {
737
+ amount: number;
738
+ username: string;
739
+ displayName: string;
740
+ providerId: string;
741
+ message: string;
742
+ tier: Subscriber.SubscriberTier;
743
+ sender: string;
744
+ gifted: true;
745
+ quantity: 0;
746
+ avatar: string;
747
+ };
748
+ type CommunityGiftedSubscriber = {
749
+ amount: number;
750
+ username: string;
751
+ displayName: string;
752
+ providerId: string;
753
+ message: string;
754
+ tier: Subscriber.SubscriberTier;
755
+ sender: string;
756
+ gifted: true;
757
+ quantity: 0;
758
+ avatar: string;
759
+ };
760
+ }
761
+ }
762
+
763
+ declare namespace YoutubeEvents {
764
+ namespace Message {
765
+ export type Data = {
766
+ listener: 'message';
767
+ event: Event;
768
+ };
769
+ export type Event = {
770
+ service: 'youtube';
771
+ data: {
772
+ kind: string;
773
+ etag: string;
774
+ id: string;
775
+ snippet: {
776
+ type: string;
777
+ liveChatId: string;
778
+ authorChannelId: string;
779
+ publishedAt: string;
780
+ hasDisplayContent: boolean;
781
+ displayMessage: string;
782
+ textMessageDetails: {
783
+ messageText: string;
784
+ };
785
+ };
786
+ authorDetails: {
787
+ channelId: string;
788
+ channelUrl: string;
789
+ displayName: string;
790
+ profileImageUrl: string;
791
+ isVerified: boolean;
792
+ isChatOwner: boolean;
793
+ isChatSponsor: boolean;
794
+ isChatModerator: boolean;
795
+ };
796
+ msgId: string;
797
+ userId: string;
798
+ nick: string;
799
+ badges: Array<Badges>;
800
+ displayName: string;
801
+ isAction: boolean;
802
+ time: number;
803
+ tags: Array<Tags>;
804
+ displayColor: string | null;
805
+ channel: string;
806
+ text: string;
807
+ avatar: string;
808
+ emotes: Array<Emotes>;
809
+ };
810
+ renderedText: string;
811
+ };
812
+ type Badges = {};
813
+ type Tags = {};
814
+ type Emotes = {};
815
+ export {};
816
+ }
817
+ namespace Superchat {
818
+ type Data = {
819
+ listener: 'superchat-latest';
820
+ event: Event;
821
+ };
822
+ type Event = {
823
+ amount: number;
824
+ avatar: string;
825
+ displayName: string;
826
+ providerId: string;
827
+ name: string;
828
+ _id: string;
829
+ sessionTop: boolean;
830
+ type: 'superchat';
831
+ originalEventName: 'superchat-latest';
832
+ };
833
+ }
834
+ namespace Subscriber {
835
+ type Data = {
836
+ listener: 'subscriber-latest';
837
+ event: Event;
838
+ };
839
+ type Event = {
840
+ avatar: string;
841
+ displayName: string;
842
+ providerId: string;
843
+ name: string;
844
+ _id: string;
845
+ sessionTop: boolean;
846
+ type: 'subscriber';
847
+ originalEventName: 'subscriber-latest';
848
+ };
849
+ }
850
+ namespace Sponsor {
851
+ type Data = {
852
+ listener: 'sponsor-latest';
853
+ event: Event;
854
+ };
855
+ type Event = common & (normal | gift | community | spam);
856
+ type common = {
857
+ amount: number;
858
+ name: string;
859
+ displayName: string;
860
+ message?: string;
861
+ providerId?: string;
862
+ avatar?: string;
863
+ sender?: string;
864
+ gifted?: boolean;
865
+ bulkGifted?: boolean;
866
+ isCommunityGift?: boolean;
867
+ _id?: string;
868
+ sessionTop?: boolean;
869
+ playedAsCommunityGift?: boolean;
870
+ type: 'sponsor';
871
+ originalEventName: 'sponsor-latest';
872
+ };
873
+ type normal = {
874
+ sender?: undefined;
875
+ gifted?: false;
876
+ bulkGifted?: false;
877
+ isCommunityGift?: false;
878
+ };
879
+ type gift = {
880
+ sender: string;
881
+ gifted: true;
882
+ bulkGifted?: false;
883
+ isCommunityGift?: false;
884
+ };
885
+ type community = {
886
+ message: string;
887
+ sender: string;
888
+ gifted?: false;
889
+ bulkGifted: true;
890
+ isCommunityGift?: false;
891
+ };
892
+ type spam = {
893
+ sender: string;
894
+ gifted: true;
895
+ bulkGifted?: false;
896
+ isCommunityGift: true;
897
+ };
898
+ }
899
+ interface BaseEvent {
900
+ provider: 'youtube';
901
+ flagged: boolean;
902
+ channel: string;
903
+ createdAt: string;
904
+ _id: string;
905
+ expiresAt: string;
906
+ updatedAt: string;
907
+ activityId: string;
908
+ sessionEventsCount: number;
909
+ isMock?: boolean;
910
+ }
911
+ namespace Event {
912
+ type Data = {
913
+ listener: 'event';
914
+ event: Event;
915
+ };
916
+ type Event = Superchat | Subscriber | Sponsor | CommunityGiftedSponsor;
917
+ interface Superchat extends BaseEvent {
918
+ type: 'superchat';
919
+ data: {
920
+ amount: string;
921
+ username: string;
922
+ message: string;
646
923
  avatar: string;
924
+ providerId: string;
647
925
  };
648
926
  }
649
- interface Cheer extends BaseEvent {
650
- type: 'cheer';
927
+ interface Subscriber extends BaseEvent {
928
+ type: 'subscriber';
651
929
  data: {
652
- amount: number;
653
- username: string;
930
+ avatar: string;
654
931
  displayName: string;
932
+ username: string;
655
933
  providerId: string;
656
- message: string;
657
- quantity: number;
658
- avatar: string;
659
934
  };
660
935
  }
661
- interface Subscriber extends BaseEvent {
662
- type: 'subscriber';
663
- data: FirstTimeSubscriber | Resubscribe | GiftedSubscriber | CommunityGiftedSubscriber;
936
+ interface Sponsor extends BaseEvent {
937
+ type: 'sponsor';
938
+ data: FirstTimeSponsor | Resubscribe | GiftedSponsor;
664
939
  }
665
- type FirstTimeSubscriber = {
940
+ type FirstTimeSponsor = {
666
941
  amount: number;
667
942
  username: string;
668
943
  displayName: string;
669
944
  providerId: string;
670
- tier: Subscriber.SubscriberTier;
671
- quantity: 0;
672
945
  avatar: string;
673
946
  };
674
947
  type Resubscribe = {
@@ -676,36 +949,27 @@ declare namespace TwitchEvents {
676
949
  username: string;
677
950
  displayName: string;
678
951
  providerId: string;
679
- message: string;
680
- tier: Subscriber.SubscriberTier;
681
- streak: number;
682
- quantity: number;
683
- avatar: string;
684
- };
685
- type GiftedSubscriber = {
686
- amount: number;
687
- username: string;
688
- displayName: string;
689
- providerId: string;
690
- message: string;
691
- tier: Subscriber.SubscriberTier;
692
- sender: string;
693
- gifted: true;
694
- quantity: 0;
695
952
  avatar: string;
696
953
  };
697
- type CommunityGiftedSubscriber = {
954
+ type GiftedSponsor = {
698
955
  amount: number;
699
956
  username: string;
700
957
  displayName: string;
701
958
  providerId: string;
702
- message: string;
703
- tier: Subscriber.SubscriberTier;
704
959
  sender: string;
705
960
  gifted: true;
706
- quantity: 0;
707
961
  avatar: string;
708
962
  };
963
+ interface CommunityGiftedSponsor extends BaseEvent {
964
+ type: 'communityGiftPurchase';
965
+ data: {
966
+ amount: number;
967
+ username: string;
968
+ displayName: string;
969
+ providerId: string;
970
+ avatar: string;
971
+ };
972
+ }
709
973
  }
710
974
  }
711
975
 
@@ -1331,295 +1595,111 @@ declare namespace StreamElements {
1331
1595
  name: string;
1332
1596
  amount: number;
1333
1597
  };
1334
- 'tip-weekly-top-donator': {
1335
- name: string;
1336
- amount: number;
1337
- };
1338
- 'tip-monthly-top-donator': {
1339
- name: string;
1340
- amount: number;
1341
- };
1342
- 'tip-alltime-top-donator': {
1343
- name: string;
1344
- amount: number;
1345
- };
1346
- 'tip-session': {
1347
- amount: number;
1348
- };
1349
- 'tip-week': {
1350
- amount: number;
1351
- };
1352
- 'tip-month': {
1353
- amount: number;
1354
- };
1355
- 'tip-total': {
1356
- amount: number;
1357
- };
1358
- 'tip-count': {
1359
- count: number;
1360
- };
1361
- 'tip-goal': {
1362
- amount: number;
1363
- };
1364
- 'tip-recent': {
1365
- name: string;
1366
- amount: number;
1367
- createdAt: string;
1368
- }[];
1369
- }
1370
- interface Merch {
1371
- 'merch-latest': {
1372
- name: string;
1373
- amount: number;
1374
- items: any[];
1375
- };
1376
- 'merch-goal-orders': {
1377
- amount: number;
1378
- };
1379
- 'merch-goal-items': {
1380
- amount: number;
1381
- };
1382
- 'merch-goal-total': {
1383
- amount: number;
1384
- };
1385
- 'merch-recent': {
1386
- name: string;
1387
- }[];
1388
- }
1389
- interface Purchase {
1390
- 'purchase-latest': {
1391
- name: string;
1392
- amount: number;
1393
- items: any[];
1394
- avatar: string;
1395
- message: string;
1396
- };
1397
- }
1398
- }
1399
- }
1400
-
1401
- type Provider$1 = 'twitch' | 'youtube' | 'kick' | 'facebook' | 'streamelements';
1402
- type ClientEvents$1 = {
1403
- provider: 'streamelements';
1404
- data: StreamElements.Event.Provider.StreamElements.Events;
1405
- } | {
1406
- provider: 'twitch';
1407
- data: StreamElements.Event.Provider.Twitch.Events;
1408
- } | {
1409
- provider: 'youtube';
1410
- data: StreamElements.Event.Provider.YouTube.Events;
1411
- } | {
1412
- provider: 'kick';
1413
- data: StreamElements.Event.Provider.Kick.Events;
1414
- } | {
1415
- provider: 'facebook';
1416
- data: StreamElements.Event.Provider.Facebook.Events;
1417
- };
1418
-
1419
- declare namespace StreamElementsEvents {
1420
- namespace Tip {
1421
- type Data = {
1422
- listener: 'tip-latest';
1423
- event: Event;
1424
- };
1425
- type Event = {
1426
- amount: number;
1427
- avatar: string;
1428
- name: string;
1429
- displayName: string;
1430
- providerId: string;
1431
- _id: string;
1432
- sessionTop: boolean;
1433
- type: 'tip';
1434
- originalEventName: 'tip-latest';
1435
- };
1436
- }
1437
- namespace KVStore {
1438
- type Data = {
1439
- listener: 'kvstore:update';
1440
- event: Event;
1441
- };
1442
- type Event = {
1443
- data: {
1444
- key: `customWidget.${string}`;
1445
- value: string | number | boolean | Record<string, any>;
1446
- };
1447
- };
1448
- }
1449
- namespace BotCounter {
1450
- type Data = {
1451
- listener: 'bot:counter';
1452
- event: Event;
1453
- };
1454
- type Event = {
1455
- counter: string;
1456
- value: number;
1457
- };
1458
- }
1459
- namespace AlertService {
1460
- type Data = {
1461
- listener: 'alertService:toggleSound';
1462
- event: Event;
1463
- };
1464
- type Event = {
1465
- muted: boolean;
1466
- };
1467
- }
1468
- namespace EventSkip {
1469
- type Data = {
1470
- listener: 'event:skip';
1471
- event: Event;
1472
- };
1473
- type Event = {};
1474
- }
1475
- namespace EventTest {
1476
- export type Data = {
1477
- listener: 'event:test';
1478
- event: Event;
1479
- };
1480
- export type Event = widgetButton | emulatedEvents<EventType> | Session;
1481
- type items = {
1482
- name: string;
1483
- price: number;
1484
- quantity: number;
1485
- };
1486
- type widgetButton = {
1487
- listener: 'widget-button';
1488
- field: string;
1489
- value: string | number | boolean;
1490
- };
1491
- type EventType = 'follower' | 'subscriber' | 'tip' | 'cheer' | 'raid';
1492
- type EventTier = 'prime' | '1000' | '2000' | '3000';
1493
- type emulatedEvents<T extends EventType> = {
1494
- listener: `${T}-latest`;
1495
- event: {
1496
- type: T;
1497
- name: string;
1498
- amount: number;
1499
- count: number;
1500
- message?: string;
1501
- gifted?: boolean;
1502
- bulkGifted?: boolean;
1503
- sender?: string;
1504
- subExtension?: boolean;
1505
- items: items[];
1506
- tier: EventTier;
1507
- month: string;
1508
- isTest: true;
1509
- };
1510
- };
1511
- type Session = SessionCount | SessionTotal | SessionTop | SessionGoal | SessionRecent | SessionPoints;
1512
- type SessionCount = {
1513
- listener: `${EventType}-count`;
1514
- event: {
1515
- type: EventType;
1516
- name: string;
1517
- count: number;
1518
- items: items[];
1519
- tier: EventTier;
1520
- month: string;
1521
- isTest: true;
1522
- };
1523
- };
1524
- type SessionTotal = {
1525
- listener: `${EventType}-total`;
1526
- event: {
1527
- type: EventType;
1528
- name: string;
1529
- amount: number;
1530
- count: number;
1531
- items: items[];
1532
- tier: EventTier;
1533
- month: string;
1534
- isTest: true;
1535
- };
1536
- };
1537
- type SessionTop = {
1538
- listener: `${EventType}-top`;
1539
- event: {
1540
- type: EventType;
1598
+ 'tip-weekly-top-donator': {
1541
1599
  name: string;
1542
1600
  amount: number;
1543
- count: number;
1544
- items: items[];
1545
- tier: EventTier;
1546
- month: string;
1547
- isTest: true;
1548
1601
  };
1549
- };
1550
- type SessionGoal = {
1551
- listener: `${EventType}-goal`;
1552
- event: {
1553
- type: EventType;
1602
+ 'tip-monthly-top-donator': {
1603
+ name: string;
1604
+ amount: number;
1605
+ };
1606
+ 'tip-alltime-top-donator': {
1554
1607
  name: string;
1555
1608
  amount: number;
1609
+ };
1610
+ 'tip-session': {
1611
+ amount: number;
1612
+ };
1613
+ 'tip-week': {
1614
+ amount: number;
1615
+ };
1616
+ 'tip-month': {
1617
+ amount: number;
1618
+ };
1619
+ 'tip-total': {
1620
+ amount: number;
1621
+ };
1622
+ 'tip-count': {
1556
1623
  count: number;
1557
- items: items[];
1558
- tier: EventTier;
1559
- month: string;
1560
- isTest: true;
1561
1624
  };
1562
- };
1563
- type SessionRecent = {
1564
- listener: `${EventType}-recent`;
1565
- event: {
1566
- event: SessionRecentEvent[];
1625
+ 'tip-goal': {
1626
+ amount: number;
1567
1627
  };
1568
- };
1569
- type SessionRecentEvent = {
1570
- type: EventType;
1571
- name: string;
1572
- amount: number;
1573
- count: number;
1574
- tier: EventTier;
1575
- isTest: true;
1576
- };
1577
- type SessionPoints = {
1578
- listener: `${EventType}-points`;
1579
- event: {
1580
- type: EventType;
1628
+ 'tip-recent': {
1581
1629
  name: string;
1582
1630
  amount: number;
1583
- count: number;
1584
- items: items[];
1585
- tier: EventTier;
1586
- month: string;
1587
- isTest: true;
1631
+ createdAt: string;
1632
+ }[];
1633
+ }
1634
+ interface Merch {
1635
+ 'merch-latest': {
1636
+ name: string;
1637
+ amount: number;
1638
+ items: any[];
1588
1639
  };
1589
- };
1590
- export {};
1591
- }
1592
- interface BaseEvent {
1593
- provider: Provider$1;
1594
- flagged: boolean;
1595
- channel: string;
1596
- createdAt: string;
1597
- _id: string;
1598
- expiresAt: string;
1599
- updatedAt: string;
1600
- activityId: string;
1601
- sessionEventsCount: number;
1602
- isMock?: boolean;
1603
- }
1604
- namespace Event {
1605
- type Data = {
1606
- listener: 'event';
1607
- event: Event;
1608
- };
1609
- type Event = Tip;
1610
- interface Tip extends BaseEvent {
1611
- type: 'tip';
1612
- data: {
1613
- amount: string;
1614
- currency: string;
1615
- username: string;
1616
- message: string;
1640
+ 'merch-goal-orders': {
1641
+ amount: number;
1642
+ };
1643
+ 'merch-goal-items': {
1644
+ amount: number;
1645
+ };
1646
+ 'merch-goal-total': {
1647
+ amount: number;
1648
+ };
1649
+ 'merch-recent': {
1650
+ name: string;
1651
+ }[];
1652
+ }
1653
+ interface Purchase {
1654
+ 'purchase-latest': {
1655
+ name: string;
1656
+ amount: number;
1657
+ items: any[];
1617
1658
  avatar: string;
1659
+ message: string;
1618
1660
  };
1619
1661
  }
1620
1662
  }
1621
1663
  }
1622
1664
 
1665
+ interface CommandOptions {
1666
+ prefix?: string;
1667
+ name: string;
1668
+ description?: string;
1669
+ arguments?: boolean;
1670
+ run: (this: Client, args: string[], event: CommandEvent) => void;
1671
+ test?: string;
1672
+ aliases?: string[];
1673
+ permissions?: string[] | boolean;
1674
+ admins?: string[];
1675
+ }
1676
+ type CommandEvent = {
1677
+ provider: 'twitch';
1678
+ data: StreamElements.Event.Provider.Twitch.Message;
1679
+ } | {
1680
+ provider: 'youtube';
1681
+ data: StreamElements.Event.Provider.YouTube.Message;
1682
+ } | {
1683
+ provider: 'kick';
1684
+ data: any;
1685
+ };
1686
+ declare class Command {
1687
+ prefix: string;
1688
+ name: string;
1689
+ description: string;
1690
+ arguments: boolean;
1691
+ test: string | (() => string);
1692
+ aliases: string[];
1693
+ permissions?: string[] | boolean;
1694
+ admins: string[];
1695
+ constructor(options: CommandOptions);
1696
+ run(this: Client | undefined, args: string[], event: CommandEvent): void;
1697
+ verify(nickname: string, roles: string[], args: string[]): boolean;
1698
+ parse(text: string, event: CommandEvent): boolean;
1699
+ remove(): void;
1700
+ static execute(received: CommandEvent): boolean;
1701
+ }
1702
+
1623
1703
  /**
1624
1704
  * EventProvider class for managing event listeners and emitters.
1625
1705
  * This class allows you to register event listeners, emit events, and manage event subscriptions.
@@ -1731,44 +1811,6 @@ declare class useStorage<T extends JSONObject> extends EventProvider<UseStorageE
1731
1811
  on<K extends keyof UseStorageEvents<T>>(eventName: K, callback: (this: useStorage<T>, ...args: UseStorageEvents<T>[K]) => void): this;
1732
1812
  }
1733
1813
 
1734
- interface CommandOptions {
1735
- prefix?: string;
1736
- name: string;
1737
- description?: string;
1738
- arguments?: boolean;
1739
- run: (this: Client, args: string[], event: CommandEvent) => void;
1740
- test?: string;
1741
- aliases?: string[];
1742
- permissions?: string[] | boolean;
1743
- admins?: string[];
1744
- }
1745
- type CommandEvent = {
1746
- provider: 'twitch';
1747
- data: StreamElements.Event.Provider.Twitch.Message;
1748
- } | {
1749
- provider: 'youtube';
1750
- data: StreamElements.Event.Provider.YouTube.Message;
1751
- } | {
1752
- provider: 'kick';
1753
- data: any;
1754
- };
1755
- declare class Command {
1756
- prefix: string;
1757
- name: string;
1758
- description: string;
1759
- arguments: boolean;
1760
- test: string | (() => string);
1761
- aliases: string[];
1762
- permissions?: string[] | boolean;
1763
- admins: string[];
1764
- constructor(options: CommandOptions);
1765
- run(this: Client | undefined, args: string[], event: CommandEvent): void;
1766
- verify(nickname: string, roles: string[], args: string[]): boolean;
1767
- parse(text: string, event: CommandEvent): boolean;
1768
- remove(): void;
1769
- static execute(received: CommandEvent): boolean;
1770
- }
1771
-
1772
1814
  declare namespace Alejo {
1773
1815
  namespace Pronouns {
1774
1816
  type name = 'hehim' | 'sheher' | 'theythem' | 'shethem' | 'hethem' | 'heshe' | 'xexem' | 'faefaer' | 'vever' | 'aeaer' | 'ziehir' | 'perper' | 'eem' | 'itits';
@@ -1855,6 +1897,10 @@ declare class Client extends EventProvider<ClientEvents> {
1855
1897
  on<K extends keyof ClientEvents>(eventName: K, callback: (this: Client, ...args: ClientEvents[K]) => void): this;
1856
1898
  }
1857
1899
 
1900
+ type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
1901
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
1902
+ }[Keys];
1903
+
1858
1904
  interface ButtonOptions {
1859
1905
  field: string | ((field: string, value: string | boolean | number) => boolean);
1860
1906
  template?: string;
@@ -2108,49 +2154,81 @@ declare class useComfyJs extends EventProvider<ComfyEvents> {
2108
2154
  private connect;
2109
2155
  }
2110
2156
 
2111
- type BadgeOptions = Twitch.roles[] | Twitch.roles | `${Twitch.roles}/${number}` | `${Twitch.roles}/${number}`[];
2112
- type TwitchResult = {
2113
- keys: Twitch.roles[];
2114
- badges: Twitch.badge[];
2115
- amount: {
2116
- [K in Twitch.roles]?: number;
2117
- };
2118
- };
2119
- type YouTubeResult = {
2120
- isVerified: boolean;
2121
- isChatOwner: boolean;
2122
- isChatSponsor: boolean;
2123
- isChatModerator: boolean;
2124
- };
2125
- declare class MessageHelper {
2126
- /**
2127
- * Finds emotes in a given text.
2128
- * @param text - The text to search for emotes.
2129
- * @param emotes - An array of emotes to search for. Defaults to Local data emotes.
2130
- * @returns An array of emotes found in the text with their positions.
2131
- */
2132
- findEmotesInText(text: string, emotes?: Emote[]): Emote[];
2133
- /**
2134
- * Replaces emotes in the text with corresponding HTML image tags.
2135
- * @param text - The text containing emotes.
2136
- * @param emotes - An array of emotes with their positions in the text.
2137
- * @returns The text with emotes replaced by HTML image tags.
2138
- */
2139
- replaceEmotesWithHTML(text: string, emotes: Emote[]): string;
2140
- /**
2141
- * Checks if the text contains only emotes and whitespace.
2142
- * @param text - The text to check.
2143
- * @param emotes - An array of emotes with their positions in the text.
2144
- * @returns True if the text contains only emotes and whitespace, false otherwise.
2145
- */
2146
- hasOnlyEmotes(text: string, emotes: Emote[]): boolean;
2147
- /**
2148
- * Replaces YouTube emotes in the text with corresponding HTML image tags.
2149
- * @param text - The text containing YouTube emotes.
2150
- * @param emotes - An array of YouTube emotes. Defaults to Local data YouTube emotes.
2151
- * @returns The text with YouTube emotes replaced by HTML image tags.
2152
- */
2153
- replaceYoutubeEmotesWithHTML(text: string, emotes?: {
2157
+ declare namespace Data {
2158
+ const avatars: string[];
2159
+ const badges: Twitch.GlobalBadge[];
2160
+ const css_color_names: string[];
2161
+ const items: any[];
2162
+ const names: string[];
2163
+ const tiers: string[];
2164
+ const tts: string[];
2165
+ const messages: string[];
2166
+ const normal_messages: string[];
2167
+ const twitch_messages: string[];
2168
+ const youtube_messages: string[];
2169
+ const emotes: (TwitchEmote | BttvEmote | SeventvEmote)[];
2170
+ const ffz_emotes: {
2171
+ id: string;
2172
+ name: string;
2173
+ platform: string;
2174
+ animated: boolean;
2175
+ urls: {
2176
+ '1': string;
2177
+ '2': string;
2178
+ '4': string;
2179
+ };
2180
+ }[];
2181
+ const bttv_emotes: {
2182
+ id: string;
2183
+ name: string;
2184
+ platform: string;
2185
+ animated: boolean;
2186
+ urls: {
2187
+ '1': string;
2188
+ '2': string;
2189
+ '4': string;
2190
+ };
2191
+ }[];
2192
+ const seventv_emotes: {
2193
+ id: string;
2194
+ name: string;
2195
+ platform: string;
2196
+ animated: boolean;
2197
+ urls: {
2198
+ '1': string;
2199
+ '2': string;
2200
+ '3': string;
2201
+ '4': string;
2202
+ };
2203
+ }[];
2204
+ const twitch_emotes: ({
2205
+ type: string;
2206
+ name: string;
2207
+ id: string;
2208
+ gif: boolean;
2209
+ animated: boolean;
2210
+ urls: {
2211
+ '1': string;
2212
+ '2': string;
2213
+ '4': string;
2214
+ };
2215
+ start: number;
2216
+ end: number;
2217
+ } | {
2218
+ type: string;
2219
+ name: string;
2220
+ id: string;
2221
+ gif: boolean;
2222
+ urls: {
2223
+ '1': string;
2224
+ '2': string;
2225
+ '4': string;
2226
+ };
2227
+ start: number;
2228
+ end: number;
2229
+ animated?: undefined;
2230
+ })[];
2231
+ const youtube_emotes: {
2154
2232
  emojiId: string;
2155
2233
  shortcuts: string[];
2156
2234
  searchTerms: string[];
@@ -2168,174 +2246,7 @@ declare class MessageHelper {
2168
2246
  };
2169
2247
  isCustomEmoji: boolean;
2170
2248
  index: number;
2171
- }[]): string;
2172
- /**
2173
- * Generates badge data based on the provided badges and platform.
2174
- * @param badges - The badges to generate. Can be an array or a comma-separated string.
2175
- * @param provider - The platform provider ('twitch' or 'youtube'). Defaults to 'twitch'.
2176
- * @returns A promise that resolves to the generated badge data.
2177
- * @example
2178
- * ```javascript
2179
- * // Generate Twitch badges
2180
- * const twitchBadges = await generateBadges(['broadcaster', 'moderator'], 'twitch');
2181
- * // Generate YouTube badges
2182
- * const youtubeBadges = await generateBadges('sponsor, moderator', 'youtube');
2183
- * ```
2184
- */
2185
- generateBadges<T extends Provider$1>(badges: BadgeOptions | undefined, provider: T): Promise<T extends 'twitch' ? TwitchResult : YouTubeResult>;
2186
- }
2187
-
2188
- declare namespace Local {
2189
- type QueueItem = {
2190
- listener: 'onEventReceived';
2191
- data: StreamElements.Event.onEventReceived;
2192
- session?: boolean;
2193
- } | {
2194
- listener: 'onWidgetLoad';
2195
- data: StreamElements.Event.onWidgetLoad;
2196
- } | {
2197
- listener: 'onSessionUpdate';
2198
- data: StreamElements.Event.onSessionUpdate;
2199
- };
2200
- const queue: useQueue<QueueItem>;
2201
- const generate: {
2202
- session: {
2203
- types: Record<string, StreamElements.Session.Config.Any>;
2204
- available(): StreamElements.Session.Config.Available.Data;
2205
- get(startSession?: StreamElements.Session.Data): Promise<StreamElements.Session.Data>;
2206
- };
2207
- event: {
2208
- /**
2209
- * Simulates the onWidgetLoad event for a widget.
2210
- * @param fields - The field values to be included in the event.
2211
- * @param session - The session data to be included in the event.
2212
- * @param currency - The currency to be used (default is 'USD').
2213
- * @returns A Promise that resolves to the simulated onWidgetLoad event data.
2214
- */
2215
- onWidgetLoad(fields: Record<string, StreamElements.CustomField.Value>, session: StreamElements.Session.Data, currency?: "BRL" | "USD" | "EUR"): Promise<StreamElements.Event.onWidgetLoad>;
2216
- /**
2217
- * Simulates the onSessionUpdate event for a widget.
2218
- * @param session - The session data to be included in the event.
2219
- * @returns A Promise that resolves to the simulated onSessionUpdate event data.
2220
- */
2221
- onSessionUpdate(session?: StreamElements.Session.Data, update?: ClientEvents$1): Promise<StreamElements.Event.onSessionUpdate>;
2222
- /**
2223
- * Simulates the onEventReceived event for a widget.
2224
- * @param provider - The provider of the event (default is 'random').
2225
- * @param type - The type of event to simulate (default is 'random').
2226
- * @param options - Additional options to customize the event data.
2227
- * @returns A Promise that resolves to the simulated onEventReceived event data, or null if the event type is not supported.
2228
- * @example
2229
- * ```javascript
2230
- * // Simulate a random event
2231
- * const randomEvent = await Local .generate.event.onEventReceived();
2232
- *
2233
- * // Simulate a Twitch message event with custom options
2234
- * const twitchMessageEvent = await Local .generate.event.onEventReceived('twitch', 'message', { name: 'Streamer', message: 'Hello World!' });
2235
- * ```
2236
- */
2237
- onEventReceived(provider?: Provider$1 | "random", type?: StreamElements.Event.onEventReceived["listener"] | "random" | "tip" | "cheer" | "follower" | "raid" | "subscriber", options?: Record<string, string | number | boolean>): Promise<StreamElements.Event.onEventReceived | null>;
2238
- };
2239
- };
2240
- const emulate: {
2241
- twitch: {
2242
- message(data?: Partial<{
2243
- name: string;
2244
- message: string;
2245
- badges: BadgeOptions;
2246
- color: string;
2247
- userId: string;
2248
- msgId: string;
2249
- channel: string;
2250
- time: number;
2251
- firstMsg: boolean;
2252
- returningChatter: boolean;
2253
- reply: {
2254
- msgId: string;
2255
- userId: string;
2256
- login: string;
2257
- name: string;
2258
- text: string;
2259
- };
2260
- thread: {
2261
- msgId: string;
2262
- name: string;
2263
- };
2264
- }>): void;
2265
- deleteMessage(msgId: string): void;
2266
- deleteMessages(userId: string): void;
2267
- follower(data?: Partial<{
2268
- avatar: string;
2269
- name: string;
2270
- }>): void;
2271
- raid(data?: Partial<{
2272
- amount: number;
2273
- avatar: string;
2274
- name: string;
2275
- }>): void;
2276
- cheer(data?: Partial<{
2277
- amount: number;
2278
- avatar: string;
2279
- name: string;
2280
- message: string;
2281
- }>): void;
2282
- subscriber(data?: Partial<{
2283
- tier: "1000" | "2000" | "3000" | "prime";
2284
- amount: number;
2285
- avatar: string;
2286
- name: string;
2287
- sender: string;
2288
- message: string;
2289
- subType: "default" | "gift" | "community" | "spam";
2290
- }> & {
2291
- subType?: "default" | "gift" | "community" | "spam";
2292
- }): void;
2293
- };
2294
- streamelements: {
2295
- tip(data?: Partial<{
2296
- amount: number;
2297
- avatar: string;
2298
- name: string;
2299
- }>): void;
2300
- };
2301
- youtube: {
2302
- message(data?: Partial<{
2303
- name: string;
2304
- message: string;
2305
- badges: BadgeOptions;
2306
- color: string;
2307
- userId: string;
2308
- msgId: string;
2309
- channel: string;
2310
- time: number;
2311
- avatar: string;
2312
- }>): void;
2313
- subscriber(data?: Partial<{
2314
- avatar: string;
2315
- name: string;
2316
- }>): void;
2317
- superchat(data?: Partial<{
2318
- amount: number;
2319
- avatar: string;
2320
- name: string;
2321
- }>): void;
2322
- sponsor(data?: Partial<{
2323
- tier: "1000" | "2000" | "3000";
2324
- amount: number;
2325
- avatar: string;
2326
- name: string;
2327
- sender: string;
2328
- message: string;
2329
- subType: "default" | "gift" | "community" | "spam";
2330
- }> & {
2331
- subType?: "default" | "gift" | "community" | "spam";
2332
- }): void;
2333
- };
2334
- kick: {};
2335
- facebook: {};
2336
- send<T extends "onEventReceived" | "onSessionUpdate" | "onWidgetLoad">(listener: T, event: T extends "onEventReceived" ? StreamElements.Event.onEventReceived : T extends "onSessionUpdate" ? StreamElements.Event.onSessionUpdate : StreamElements.Event.onWidgetLoad): void;
2337
- };
2338
- function start(fieldsFile?: string[], dataFiles?: string[], session?: StreamElements.Session.Data): Promise<void>;
2249
+ }[];
2339
2250
  }
2340
2251
 
2341
2252
  /**
@@ -2536,23 +2447,153 @@ declare class ObjectHelper {
2536
2447
  */
2537
2448
  flatten(obj: Record<string, any>, stringify?: boolean, prefix?: string): Record<string, typeof stringify extends true ? string : string | number | boolean>;
2538
2449
  /**
2539
- * Returns the entries of an object as an array of key-value pairs, with proper typing.
2540
- * @param obj - The object to retrieve entries from.
2541
- * @returns An array of key-value pairs from the object, typed as an array of tuples with key and value types.
2450
+ * Returns the entries of an object as an array of key-value pairs, with proper typing.
2451
+ * @param obj - The object to retrieve entries from.
2452
+ * @returns An array of key-value pairs from the object, typed as an array of tuples with key and value types.
2453
+ */
2454
+ entries<K extends string, V>(obj: Record<K, V>): [K, V][];
2455
+ /**
2456
+ * Returns the values of an object as an array, with proper typing.
2457
+ * @param obj - The object to retrieve values from.
2458
+ * @returns An array of values from the object, typed as an array of the value type.
2459
+ */
2460
+ values<K extends string, V>(obj: Record<K, V>): V[];
2461
+ /**
2462
+ * Returns the keys of an object as an array of strings, with proper typing.
2463
+ * @param obj - The object to retrieve keys from.
2464
+ * @returns An array of keys from the object, typed as an array of strings.
2465
+ */
2466
+ keys<K extends string, V>(obj: Record<K, V>): K[];
2467
+ }
2468
+
2469
+ type BadgeOptions = Twitch.tags[] | Twitch.tags | `${Twitch.tags}/${string}` | `${Twitch.tags}/${string}`[];
2470
+ type TwitchResult = {
2471
+ keys: Twitch.tags[];
2472
+ badges: Twitch.badge[];
2473
+ versions: {
2474
+ [K in Twitch.tags]?: string | number;
2475
+ };
2476
+ amount: {
2477
+ [K in Twitch.tags]?: string | number;
2478
+ };
2479
+ };
2480
+ type YouTubeResult = {
2481
+ isVerified: boolean;
2482
+ isChatOwner: boolean;
2483
+ isChatSponsor: boolean;
2484
+ isChatModerator: boolean;
2485
+ };
2486
+ declare class MessageHelper {
2487
+ /**
2488
+ * Finds emotes in a given text.
2489
+ * @param text - The text to search for emotes.
2490
+ * @param emotes - An array of emotes to search for. Defaults to Local data emotes.
2491
+ * @returns An array of emotes found in the text with their positions.
2492
+ */
2493
+ findEmotesInText(text: string, emotes?: Emote[]): Emote[];
2494
+ /**
2495
+ * Replaces emotes in the text with corresponding HTML image tags.
2496
+ * @param text - The text containing emotes.
2497
+ * @param emotes - An array of emotes with their positions in the text.
2498
+ * @returns The text with emotes replaced by HTML image tags.
2499
+ */
2500
+ replaceEmotesWithHTML(text: string, emotes: Emote[]): string;
2501
+ /**
2502
+ * Checks if the text contains only emotes and whitespace.
2503
+ * @param text - The text to check.
2504
+ * @param emotes - An array of emotes with their positions in the text.
2505
+ * @returns True if the text contains only emotes and whitespace, false otherwise.
2506
+ */
2507
+ hasOnlyEmotes(text: string, emotes: Emote[]): boolean;
2508
+ /**
2509
+ * Replaces YouTube emotes in the text with corresponding HTML image tags.
2510
+ * @param text - The text containing YouTube emotes.
2511
+ * @param emotes - An array of YouTube emotes. Defaults to Local data YouTube emotes.
2512
+ * @returns The text with YouTube emotes replaced by HTML image tags.
2513
+ */
2514
+ replaceYoutubeEmotesWithHTML(text: string, emotes?: {
2515
+ emojiId: string;
2516
+ shortcuts: string[];
2517
+ searchTerms: string[];
2518
+ image: {
2519
+ thumbnails: {
2520
+ url: string;
2521
+ width: number;
2522
+ height: number;
2523
+ }[];
2524
+ accessibility: {
2525
+ accessibilityData: {
2526
+ label: string;
2527
+ };
2528
+ };
2529
+ };
2530
+ isCustomEmoji: boolean;
2531
+ index: number;
2532
+ }[]): string;
2533
+ /**
2534
+ * Maps global badge versions to a structured format.
2535
+ * @param globalBadges - An array of Twitch global badges. Defaults to Local data badges.
2536
+ * @returns An array of objects containing badge IDs and their corresponding versions.
2537
+ * @example
2538
+ * ```javascript
2539
+ * const badgeVersions = mapGlobalBadgeVersions();
2540
+ * console.log(badgeVersions);
2541
+ * // Output:
2542
+ * [
2543
+ * {
2544
+ * id: 'subscriber',
2545
+ * versions: [
2546
+ * { type: 'subscriber', version: '1', url: 'https://...', description: 'Subscriber' },
2547
+ * { type: 'subscriber', version: '2', url: 'https://...', description: '2-Month Subscriber' },
2548
+ * // ... more versions
2549
+ * ],
2550
+ * },
2551
+ * {
2552
+ * id: 'bits',
2553
+ * versions: [
2554
+ * { type: 'bits', version: '100', url: 'https://...', description: 'cheer 100' },
2555
+ * { type: 'bits', version: '1000', url: 'https://...', description: 'cheer 1000' },
2556
+ * // ... more versions
2557
+ * ],
2558
+ * },
2559
+ * // ... more badges
2560
+ * ]
2561
+ * ```
2542
2562
  */
2543
- entries<K extends string, V>(obj: Record<K, V>): [K, V][];
2563
+ mapGlobalBadgeVersions(globalBadges?: Twitch.GlobalBadge[]): Array<{
2564
+ id: Twitch.tags;
2565
+ versions: Twitch.badge[];
2566
+ }>;
2544
2567
  /**
2545
- * Returns the values of an object as an array, with proper typing.
2546
- * @param obj - The object to retrieve values from.
2547
- * @returns An array of values from the object, typed as an array of the value type.
2568
+ * Maps a badge type and variation to the corresponding badge version amount.
2569
+ * @param type - The badge type (e.g., 'subscriber', 'bits', etc.).
2570
+ * @param variation - The badge variation, which can be a number or a string (e.g., 'horde', 'alliance', etc.).
2571
+ * @returns The badge version amount as a string. Returns '0' if no matching badge version is found.
2572
+ * @example
2573
+ * ```javascript
2574
+ * // For subscriber badge with 3 months
2575
+ * mapGlobalBadgeVersionAmount('subscriber', 3); // Returns '3'
2576
+ * // For bits badge with 5000 bits
2577
+ * mapGlobalBadgeVersionAmount('bits', 5000); // Returns the corresponding badge version based on the mapping
2578
+ * // For warcraft badge with 'horde' variation
2579
+ * mapGlobalBadgeVersionAmount('warcraft', 'horde'); // Returns 'horde'
2580
+ * ```
2548
2581
  */
2549
- values<K extends string, V>(obj: Record<K, V>): V[];
2582
+ mapGlobalBadgeVersionAmount(type: Twitch.tags, variation: string | number): string;
2550
2583
  /**
2551
- * Returns the keys of an object as an array of strings, with proper typing.
2552
- * @param obj - The object to retrieve keys from.
2553
- * @returns An array of keys from the object, typed as an array of strings.
2584
+ * Generates badge data based on the provided badges and platform.
2585
+ * @param badges - The badges to generate. Can be an array or a comma-separated string.
2586
+ * @param provider - The platform provider ('twitch' or 'youtube'). Defaults to 'twitch'.
2587
+ * @returns A promise that resolves to the generated badge data.
2588
+ * @example
2589
+ * ```javascript
2590
+ * // Generate Twitch badges
2591
+ * const twitchBadges = await generateBadges(['broadcaster', 'moderator'], 'twitch');
2592
+ * // Generate YouTube badges
2593
+ * const youtubeBadges = await generateBadges('sponsor, moderator', 'youtube');
2594
+ * ```
2554
2595
  */
2555
- keys<K extends string, V>(obj: Record<K, V>): K[];
2596
+ generateBadges<T extends Provider$1>(badges: BadgeOptions | undefined, provider: T): Promise<T extends 'twitch' ? TwitchResult : YouTubeResult>;
2556
2597
  }
2557
2598
 
2558
2599
  declare class RandomHelper {
@@ -2604,11 +2645,15 @@ declare class RandomHelper {
2604
2645
  * @returns - Random string
2605
2646
  * @example
2606
2647
  * ```javascript
2607
- * const randString = random.string(10);
2608
- * console.log(randString); // e.g. "aZ3bT9xYqP"
2648
+ * const randString = random.string(10); // e.g. "aZ3bT9qP1x"
2649
+ * const randHex = random.string(8, 'hex'); // e.g. "4f3c2a1b"
2650
+ * const randNumStr = random.string(6, 'numbers'); // e.g. "839201"
2651
+ * const randLetterStr = random.string(6, 'letters'); // e.g. "aZbTqP"
2652
+ * const randHexUpper = random.string(6, 'hex-upper'); // e.g. "4F3C2A1B"
2653
+ * const randHexLower = random.string(6, 'hex-lower'); // e.g. "4f3c2a1b"
2609
2654
  * ```
2610
2655
  */
2611
- string(length: number, chars?: string): string;
2656
+ string(length: number, chars?: 'numeric' | 'numbers' | 'letters' | 'hex' | 'hex-upper' | 'hex-lower' | string): string;
2612
2657
  /**
2613
2658
  * Pick random element from array
2614
2659
  * @param arr - Array to pick from
@@ -2878,13 +2923,179 @@ declare class UtilsHelper {
2878
2923
  * @returns An array of keys from the object.
2879
2924
  */
2880
2925
  typedKeys<K extends string, V>(obj: Record<K, V> | Array<V>): K[];
2926
+ /**
2927
+ * Compares two dates and returns the difference in multiple time units.
2928
+ *
2929
+ * `total` values are based on raw milliseconds (can be decimal).
2930
+ * `calendar` values use calendar boundaries for full months/years.
2931
+ */
2932
+ compareDates(date1: Date | string, date2: Date | string): {
2933
+ milliseconds: number;
2934
+ seconds: number;
2935
+ minutes: number;
2936
+ hours: number;
2937
+ days: number;
2938
+ months: number;
2939
+ years: number;
2940
+ absolute: {
2941
+ milliseconds: number;
2942
+ seconds: number;
2943
+ minutes: number;
2944
+ hours: number;
2945
+ days: number;
2946
+ months: number;
2947
+ years: number;
2948
+ };
2949
+ calendar: {
2950
+ months: number;
2951
+ years: number;
2952
+ };
2953
+ isFuture: boolean;
2954
+ isPast: boolean;
2955
+ isSameMoment: boolean;
2956
+ };
2881
2957
  /**
2882
2958
  * Selects an item based on weighted probabilities.
2883
2959
  * @param items - An object where keys are items and values are their weights.
2884
2960
  * @returns A randomly selected item based on the given probabilities.
2961
+ * @example
2962
+ * ```ts
2963
+ * const utils = new UtilsHelper();
2964
+ * const result = utils.probability({
2965
+ * apple: 0.5,
2966
+ * banana: 0.3,
2967
+ * cherry: 0.2,
2968
+ * });
2969
+ * console.log(result); // 'apple', 'banana', or 'cherry' based on the defined probabilities
2970
+ * ```
2885
2971
  */
2886
2972
  probability<K extends string, V extends number>(items: Record<K, V>): K | undefined;
2973
+ /**
2974
+ * Finds the subscription tier of a user based on various sources of information.
2975
+ * @param data - An object containing userId, name, and broadcasterId to identify the user.
2976
+ * @param session - The current session data which may contain recent subscription information.
2977
+ * @param checkWithAPI - Whether to check the subscription tier with an external API as a last resort.
2978
+ * @returns A promise that resolves to the subscription tier of the user (1, 2, or 3).
2979
+ * @example
2980
+ * ```javascript
2981
+ * const utils = new UtilsHelper();
2982
+ * const tier = await utils.findSubscriptionTier(
2983
+ * { userId: '12345', name: 'exampleUser', broadcasterId: '67890' },
2984
+ * sessionData,
2985
+ * true
2986
+ * );
2987
+ * console.log(tier); // 1, 2, or 3 based on the user's subscription tier
2988
+ * ```
2989
+ */
2990
+ findSubscriptionTier({ userId, name, broadcasterId, }: {
2991
+ userId: string;
2992
+ name: string;
2993
+ broadcasterId?: string;
2994
+ }, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<1 | 2 | 3>;
2995
+ /**
2996
+ * Identifies a user based on the received event and session data, returning their ID, name, role, badges, and top status.
2997
+ * @param receivedEvent - The event received from the provider (Twitch or YouTube) containing user information.
2998
+ * @param session - The current session data which may contain recent activity and top user information.
2999
+ * @returns A promise that resolves to an object containing the user's ID, name, role, badges, and top status, or undefined if the user cannot be identified.
3000
+ * @example
3001
+ * ```javascript
3002
+ * const utils = new UtilsHelper();
3003
+ * const userInfo = await utils.identifyUser(receivedEvent, sessionData);
3004
+ * console.log(userInfo);
3005
+ * // {
3006
+ * // id: '12345',
3007
+ * // name: 'exampleUser',
3008
+ * // role: 'moderator',
3009
+ * // badges: [{ type: 'moderator', version: '1', url: 'https:...', description: 'Moderator' }],
3010
+ * // top: {
3011
+ * // gifter: false,
3012
+ * // tip: {
3013
+ * // session: { donator: false, donation: false },
3014
+ * // weekly: { donator: false, donation: false },
3015
+ * // monthly: { donator: false, donation: false },
3016
+ * // alltime: { donator: false, donation: false },
3017
+ * // },
3018
+ * // ...
3019
+ * // }
3020
+ * // }
3021
+ * ```
3022
+ */
3023
+ identifyUser(receivedEvent: StreamElements.Event.Provider.Twitch.Message | StreamElements.Event.Provider.YouTube.Message, session: StreamElements.Session.Data): Promise<IdentifyYouTubeResult | IdentifyTwitchResult | undefined>;
2887
3024
  }
3025
+ type TopType = {
3026
+ gifter: boolean;
3027
+ tip: {
3028
+ session: {
3029
+ donator: boolean;
3030
+ donation: boolean;
3031
+ };
3032
+ weekly: {
3033
+ donator: boolean;
3034
+ donation: boolean;
3035
+ };
3036
+ monthly: {
3037
+ donator: boolean;
3038
+ donation: boolean;
3039
+ };
3040
+ alltime: {
3041
+ donator: boolean;
3042
+ donation: boolean;
3043
+ };
3044
+ };
3045
+ cheer: {
3046
+ session: {
3047
+ donator: boolean;
3048
+ amount: boolean;
3049
+ };
3050
+ weekly: {
3051
+ donator: boolean;
3052
+ amount: boolean;
3053
+ };
3054
+ monthly: {
3055
+ donator: boolean;
3056
+ amount: boolean;
3057
+ };
3058
+ alltime: {
3059
+ donator: boolean;
3060
+ amount: boolean;
3061
+ };
3062
+ };
3063
+ superchat: {
3064
+ session: {
3065
+ donator: boolean;
3066
+ amount: boolean;
3067
+ };
3068
+ weekly: {
3069
+ donator: boolean;
3070
+ amount: boolean;
3071
+ };
3072
+ monthly: {
3073
+ donator: boolean;
3074
+ amount: boolean;
3075
+ };
3076
+ alltime: {
3077
+ donator: boolean;
3078
+ amount: boolean;
3079
+ };
3080
+ };
3081
+ };
3082
+ type IdentifyTwitchResult = {
3083
+ id: string;
3084
+ name: string;
3085
+ color: string;
3086
+ role: Twitch.tags;
3087
+ tags: Twitch.tags[];
3088
+ badges: string;
3089
+ tier?: 1 | 2 | 3;
3090
+ top: TopType;
3091
+ };
3092
+ type IdentifyYouTubeResult = {
3093
+ id: string;
3094
+ name: string;
3095
+ role: 'broadcaster' | 'moderator' | 'sponsor' | 'verified' | 'viewer';
3096
+ badges: unknown[];
3097
+ top: TopType;
3098
+ };
2888
3099
 
2889
3100
  declare namespace Helper {
2890
3101
  const number: NumberHelper;
@@ -2900,35 +3111,201 @@ declare namespace Helper {
2900
3111
  const utils: UtilsHelper;
2901
3112
  }
2902
3113
 
2903
- declare namespace Data {
2904
- const avatars: string[];
2905
- const badges: Record<Twitch.roles, Twitch.badge>;
2906
- const css_color_names: string[];
2907
- const emotes: (TwitchEmote | BttvEmote | SeventvEmote)[];
2908
- const items: any[];
2909
- const messages: string[];
2910
- const names: string[];
2911
- const tiers: string[];
2912
- const tts: string[];
2913
- const youtube_emotes: {
2914
- emojiId: string;
2915
- shortcuts: string[];
2916
- searchTerms: string[];
2917
- image: {
2918
- thumbnails: {
2919
- url: string;
2920
- width: number;
2921
- height: number;
2922
- }[];
2923
- accessibility: {
2924
- accessibilityData: {
2925
- label: string;
3114
+ declare namespace Local {
3115
+ type QueueItem = {
3116
+ listener: 'onEventReceived';
3117
+ data: StreamElements.Event.onEventReceived;
3118
+ session?: boolean;
3119
+ } | {
3120
+ listener: 'onWidgetLoad';
3121
+ data: StreamElements.Event.onWidgetLoad;
3122
+ } | {
3123
+ listener: 'onSessionUpdate';
3124
+ data: StreamElements.Event.onSessionUpdate;
3125
+ };
3126
+ const queue: useQueue<QueueItem>;
3127
+ const generate: {
3128
+ session: {
3129
+ types: Record<string, StreamElements.Session.Config.Any>;
3130
+ available(): StreamElements.Session.Config.Available.Data;
3131
+ get(startSession?: StreamElements.Session.Data): Promise<StreamElements.Session.Data>;
3132
+ };
3133
+ event: {
3134
+ /**
3135
+ * Simulates the onWidgetLoad event for a widget.
3136
+ * @param fields - The field values to be included in the event.
3137
+ * @param session - The session data to be included in the event.
3138
+ * @param currency - The currency to be used (default is 'USD').
3139
+ * @returns A Promise that resolves to the simulated onWidgetLoad event data.
3140
+ */
3141
+ onWidgetLoad(fields: Record<string, StreamElements.CustomField.Value>, session: StreamElements.Session.Data, currency?: "BRL" | "USD" | "EUR"): Promise<StreamElements.Event.onWidgetLoad>;
3142
+ /**
3143
+ * Simulates the onSessionUpdate event for a widget.
3144
+ * @param session - The session data to be included in the event.
3145
+ * @returns A Promise that resolves to the simulated onSessionUpdate event data.
3146
+ */
3147
+ onSessionUpdate(session?: StreamElements.Session.Data, update?: ClientEvents$1): Promise<StreamElements.Event.onSessionUpdate>;
3148
+ /**
3149
+ * Simulates the onEventReceived event for a widget.
3150
+ * @param provider - The provider of the event (default is 'random').
3151
+ * @param type - The type of event to simulate (default is 'random').
3152
+ * @param options - Additional options to customize the event data.
3153
+ * @returns A Promise that resolves to the simulated onEventReceived event data, or null if the event type is not supported.
3154
+ * @example
3155
+ * ```javascript
3156
+ * // Simulate a random event
3157
+ * const randomEvent = await Local .generate.event.onEventReceived();
3158
+ *
3159
+ * // Simulate a Twitch message event with custom options
3160
+ * const twitchMessageEvent = await Local .generate.event.onEventReceived('twitch', 'message', { name: 'Streamer', message: 'Hello World!' });
3161
+ * ```
3162
+ */
3163
+ onEventReceived(provider?: Provider$1 | "random", type?: StreamElements.Event.onEventReceived["listener"] | "random" | "tip" | "cheer" | "follower" | "raid" | "subscriber", options?: Record<string, string | number | boolean>): Promise<StreamElements.Event.onEventReceived | null>;
3164
+ };
3165
+ };
3166
+ const emulate: {
3167
+ twitch: {
3168
+ message(data?: Partial<{
3169
+ name: string;
3170
+ message: string;
3171
+ badges: BadgeOptions;
3172
+ color: string;
3173
+ userId: string;
3174
+ msgId: string;
3175
+ channel: string;
3176
+ time: number;
3177
+ firstMsg: boolean;
3178
+ returningChatter: boolean;
3179
+ reply: {
3180
+ msgId: string;
3181
+ userId: string;
3182
+ login: string;
3183
+ name: string;
3184
+ text: string;
2926
3185
  };
2927
- };
3186
+ thread: {
3187
+ msgId: string;
3188
+ name: string;
3189
+ };
3190
+ }>): void;
3191
+ deleteMessage(msgId: string): void;
3192
+ deleteMessages(userId: string): void;
3193
+ follower(data?: Partial<{
3194
+ avatar: string;
3195
+ name: string;
3196
+ }>): void;
3197
+ raid(data?: Partial<{
3198
+ amount: number;
3199
+ avatar: string;
3200
+ name: string;
3201
+ }>): void;
3202
+ cheer(data?: Partial<{
3203
+ amount: number;
3204
+ avatar: string;
3205
+ name: string;
3206
+ message: string;
3207
+ }>): void;
3208
+ subscriber(data?: Partial<{
3209
+ tier: "1000" | "2000" | "3000" | "prime";
3210
+ amount: number;
3211
+ avatar: string;
3212
+ name: string;
3213
+ sender: string;
3214
+ message: string;
3215
+ subType: "default" | "gift" | "community" | "spam";
3216
+ }> & {
3217
+ subType?: "default" | "gift" | "community" | "spam";
3218
+ }): void;
2928
3219
  };
2929
- isCustomEmoji: boolean;
2930
- index: number;
2931
- }[];
3220
+ streamelements: {
3221
+ tip(data?: Partial<{
3222
+ amount: number;
3223
+ avatar: string;
3224
+ name: string;
3225
+ }>): void;
3226
+ };
3227
+ youtube: {
3228
+ message(data?: Partial<{
3229
+ name: string;
3230
+ message: string;
3231
+ badges: BadgeOptions;
3232
+ color: string;
3233
+ userId: string;
3234
+ msgId: string;
3235
+ channel: string;
3236
+ time: number;
3237
+ avatar: string;
3238
+ }>): void;
3239
+ subscriber(data?: Partial<{
3240
+ avatar: string;
3241
+ name: string;
3242
+ }>): void;
3243
+ superchat(data?: Partial<{
3244
+ amount: number;
3245
+ avatar: string;
3246
+ name: string;
3247
+ }>): void;
3248
+ sponsor(data?: Partial<{
3249
+ tier: "1000" | "2000" | "3000";
3250
+ amount: number;
3251
+ avatar: string;
3252
+ name: string;
3253
+ sender: string;
3254
+ message: string;
3255
+ subType: "default" | "gift" | "community" | "spam";
3256
+ }> & {
3257
+ subType?: "default" | "gift" | "community" | "spam";
3258
+ }): void;
3259
+ };
3260
+ kick: {};
3261
+ facebook: {};
3262
+ send<T extends "onEventReceived" | "onSessionUpdate" | "onWidgetLoad">(listener: T, event: T extends "onEventReceived" ? StreamElements.Event.onEventReceived : T extends "onSessionUpdate" ? StreamElements.Event.onSessionUpdate : StreamElements.Event.onWidgetLoad): void;
3263
+ };
3264
+ function start(fieldsFile?: string[], dataFiles?: string[], session?: StreamElements.Session.Data): Promise<void>;
3265
+ }
3266
+
3267
+ declare class FakeUser {
3268
+ readonly id: string;
3269
+ readonly name: string;
3270
+ readonly login: string;
3271
+ badges: Twitch.tags[];
3272
+ isSubscriber: boolean;
3273
+ tier?: StreamElements.Event.Provider.Twitch.SubscriberTier;
3274
+ constructor(id: string, name: string, badges?: Twitch.tags[], isSubscriber?: boolean, tier?: StreamElements.Event.Provider.Twitch.SubscriberTier);
3275
+ }
3276
+ interface FakeUserPoolOptions {
3277
+ id?: string;
3278
+ badges?: Twitch.tags[];
3279
+ limits?: {
3280
+ [key in Twitch.tags]?: number;
3281
+ };
3282
+ fixed?: {
3283
+ [key in Twitch.tags]?: string[];
3284
+ };
3285
+ }
3286
+ type FakeUserPoolEvents = {
3287
+ 'warn': [warning: Error];
3288
+ };
3289
+ declare class FakeUserPool extends EventProvider<FakeUserPoolEvents> {
3290
+ readonly users: FakeUser[];
3291
+ readonly id: string;
3292
+ private readonly byId;
3293
+ private readonly byName;
3294
+ private readonly byBadge;
3295
+ private static fixUser;
3296
+ private static getRandomSubTier;
3297
+ constructor(names?: string[], options?: FakeUserPoolOptions);
3298
+ private start;
3299
+ pick(): FakeUser | null;
3300
+ getByName(name: string): FakeUser | null;
3301
+ getById(id: string): FakeUser | null;
3302
+ getByBadge(badge: Twitch.tags): FakeUser[];
3303
+ getToReply(target: {
3304
+ id?: string;
3305
+ name?: string;
3306
+ }, extend?: Partial<Twitch.Reply>): Twitch.Reply | null;
3307
+ buildTwitchMessage(messages?: string[]): Parameters<(typeof Local)['emulate']['twitch']['message']>[0];
3308
+ buildYouTubeMessage(messages?: string[]): Parameters<(typeof Local)['emulate']['youtube']['message']>[0];
2932
3309
  }
2933
3310
 
2934
3311
  type MessageMap = Record<string, any>;
@@ -2996,6 +3373,7 @@ declare const main: {
2996
3373
  useQueue: typeof useQueue;
2997
3374
  useLogger: typeof useLogger;
2998
3375
  useComms: typeof useComms;
3376
+ FakeUserPool: typeof FakeUserPool;
2999
3377
  };
3000
3378
  actions: {
3001
3379
  Button: typeof Button;
@@ -3009,6 +3387,7 @@ declare const main: {
3009
3387
  usedComms: useComms<any>[];
3010
3388
  usedCommands: Command[];
3011
3389
  usedButtons: Button[];
3390
+ fakeUserPools: FakeUserPool[];
3012
3391
  };
3013
3392
  pronouns: {
3014
3393
  Alejo: typeof Alejo;
@@ -3032,4 +3411,4 @@ declare global {
3032
3411
  }
3033
3412
 
3034
3413
  export { Alejo, Button, Command, EventProvider, StreamElements, StreamElementsEvents, Twitch, TwitchEvents, YoutubeEvents, main as default, useComfyJs, useLogger, useQueue, useStorage };
3035
- export type { BttvEmote, ClientEvents$1 as ClientEvents, Emoji, Emote, Provider$1 as Provider, SeventvEmote, TwitchEmote };
3414
+ export type { BttvEmote, ClientEvents$1 as ClientEvents, Emoji, Emote, FfzEmote, JSONObject, JSONPrimitive, JSONSerializable, MapNumberValuesToString, NumberAsString, PathValue, Provider$1 as Provider, RequireAtLeastOne, SeventvEmote, TwitchEmote };