multichat-ts 0.0.86 → 0.0.89
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/kick.d.ts +383 -0
- package/dist/{default/kick.js → kick.js} +10 -2
- package/package.json +2 -3
- package/src/default/kick.ts +230 -19
- package/dist/default/kick.d.ts +0 -206
- package/dist/worker/index.d.ts +0 -149
- package/dist/worker/index.js +0 -2
- package/dist/worker/kick.d.ts +0 -206
- package/dist/worker/kick.js +0 -212
- package/dist/worker/twitch.d.ts +0 -73
- package/dist/worker/twitch.js +0 -425
- package/index.js +0 -9
- package/src/worker/index.ts +0 -173
- package/src/worker/kick.ts +0 -466
- package/src/worker/twitch.ts +0 -540
- /package/dist/{default/index.d.ts → index.d.ts} +0 -0
- /package/dist/{default/index.js → index.js} +0 -0
- /package/dist/{default/twitch.d.ts → twitch.d.ts} +0 -0
- /package/dist/{default/twitch.js → twitch.js} +0 -0
package/src/default/kick.ts
CHANGED
|
@@ -12,8 +12,8 @@ type ConnectionStateEvent = { previous: ConnectionState; current: ConnectionStat
|
|
|
12
12
|
|
|
13
13
|
type EventCallbackFunctions = {
|
|
14
14
|
message: (message: Message) => unknown;
|
|
15
|
-
subscription: (data:
|
|
16
|
-
gifted: (data:
|
|
15
|
+
subscription: (data: ChatroomsV2Events['SubscriptionEvent']) => unknown;
|
|
16
|
+
gifted: (data: ChatroomV1Events['GiftedSubscriptionsEvent']) => unknown;
|
|
17
17
|
raw_message: (message: ChatMessageEvent) => unknown;
|
|
18
18
|
connection_state_changed: (state: ConnectionStateEvent) => unknown;
|
|
19
19
|
};
|
|
@@ -121,37 +121,50 @@ export class KickPusher {
|
|
|
121
121
|
| 'App\\Events\\UserBannedEvent'
|
|
122
122
|
| 'App\\Events\\UserUnbannedEvent'
|
|
123
123
|
*/
|
|
124
|
+
this.socket.subscribe(`chatroom_${channel_response.chatroom.id}`);
|
|
125
|
+
this.socket.subscribe(`chatrooms.${channel_response.chatroom.id}.v2`);
|
|
126
|
+
|
|
124
127
|
this.socket
|
|
125
|
-
.subscribe(`chatrooms.${channel_response.chatroom.id}.v2`)
|
|
126
128
|
.bind('pusher:subscription_succeeded', () =>
|
|
127
129
|
this.onSubscriptionSuccess('pusher:subscription_succeeded'),
|
|
128
130
|
)
|
|
129
|
-
.bind('App\\Events\\ChatMessageEvent', (data: ChatMessageEvent) =>
|
|
130
|
-
|
|
131
|
+
.bind('App\\Events\\ChatMessageEvent', (data: ChatroomsV2Events['ChatMessageEvent']) =>
|
|
132
|
+
this.onChatMessage(data),
|
|
133
|
+
)
|
|
134
|
+
.bind('App\\Events\\SubscriptionEvent', (data: ChatroomsV2Events['SubscriptionEvent']) =>
|
|
131
135
|
this.onChatSubscription(data),
|
|
132
136
|
)
|
|
133
|
-
.bind(
|
|
134
|
-
|
|
137
|
+
.bind(
|
|
138
|
+
'App\\Events\\GiftedSubscriptionsEvent',
|
|
139
|
+
(data: ChatroomV1Events['GiftedSubscriptionsEvent']) => this.onChatGifted(data),
|
|
135
140
|
);
|
|
136
141
|
|
|
137
142
|
this.socket.connection.bind('state_change', (state: ConnectionStateEvent) => {
|
|
138
143
|
switch (state.current) {
|
|
139
144
|
case 'connected': {
|
|
145
|
+
this.isConnected = true;
|
|
140
146
|
console.log(`Connected to Kick Pusher (${this.channel_name})!`);
|
|
141
147
|
break;
|
|
142
148
|
}
|
|
143
149
|
case 'connecting': {
|
|
150
|
+
this.isConnected = false;
|
|
144
151
|
console.log(`Connecting to Kick Pusher (${this.channel_name})...`);
|
|
145
152
|
break;
|
|
146
153
|
}
|
|
147
154
|
case 'failed': {
|
|
155
|
+
this.isConnected = false;
|
|
148
156
|
console.log(`Failed to connect to Kick Pusher (${this.channel_name})`);
|
|
149
157
|
break;
|
|
150
158
|
}
|
|
151
159
|
case 'unavailable': {
|
|
160
|
+
this.isConnected = false;
|
|
152
161
|
console.log(`Disconnected from Kick Pusher (${this.channel_name})`);
|
|
153
162
|
break;
|
|
154
163
|
}
|
|
164
|
+
default: {
|
|
165
|
+
this.isConnected = false;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
155
168
|
}
|
|
156
169
|
this.public_listeners.connection_state_changed?.(state);
|
|
157
170
|
});
|
|
@@ -173,15 +186,15 @@ export class KickPusher {
|
|
|
173
186
|
console.log(`Subscribed to Channel on Kick Pusher (${channel})`);
|
|
174
187
|
}
|
|
175
188
|
|
|
176
|
-
private onChatSubscription(data:
|
|
189
|
+
private onChatSubscription(data: ChatroomsV2Events['SubscriptionEvent']) {
|
|
177
190
|
this.public_listeners.subscription?.(data);
|
|
178
191
|
}
|
|
179
192
|
|
|
180
|
-
private onChatGifted(data:
|
|
193
|
+
private onChatGifted(data: ChatroomV1Events['GiftedSubscriptionsEvent']) {
|
|
181
194
|
this.public_listeners.gifted?.(data);
|
|
182
195
|
}
|
|
183
196
|
|
|
184
|
-
private onChatMessage(data: ChatMessageEvent) {
|
|
197
|
+
private onChatMessage(data: ChatroomsV2Events['ChatMessageEvent']) {
|
|
185
198
|
this.public_listeners.raw_message?.(data);
|
|
186
199
|
const text = data.content;
|
|
187
200
|
const emote_matches = [...data.content.matchAll(/\[emote:\d+:[a-zA-Z0-9]*\]/g)];
|
|
@@ -193,7 +206,6 @@ export class KickPusher {
|
|
|
193
206
|
const emote_parts = emote_string.slice(1, emote_string.length - 1).split(':');
|
|
194
207
|
const emote_id = emote_parts[1];
|
|
195
208
|
if (!emote_id) return;
|
|
196
|
-
console.log(emote_id);
|
|
197
209
|
|
|
198
210
|
body.push({
|
|
199
211
|
type: 'emote',
|
|
@@ -453,14 +465,213 @@ export interface ChatMessageEvent {
|
|
|
453
465
|
};
|
|
454
466
|
}
|
|
455
467
|
|
|
456
|
-
export interface
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
468
|
+
export interface ChannelEvents {
|
|
469
|
+
// {"user_ids":[262477],"username":"Biceus","channel_id":145224}
|
|
470
|
+
ChannelSubscriptionEvent: {
|
|
471
|
+
user_ids: number[];
|
|
472
|
+
username: string;
|
|
473
|
+
channel_id: number;
|
|
474
|
+
};
|
|
475
|
+
// {"leaderboard":[{"user_id":22,"username":"Eddie","quantity":2366},{"user_id":4349824,"username":"TinyTwink","quantity":1878},{"user_id":278971,"username":"Riri_The_Reducer","quantity":1171},{"user_id":703016,"username":"mewtoe","quantity":1143},{"user_id":24981650,"username":"ThailandMonger","quantity":750},{"user_id":5281070,"username":"Annoyinmous","quantity":700},{"user_id":739621,"username":"kfcbelly","quantity":621},{"user_id":367058,"username":"xWendy","quantity":512},{"user_id":35722,"username":"ABZ","quantity":509},{"user_id":723,"username":"Trainwreckstv","quantity":500}],"weekly_leaderboard":[{"user_id":11837402,"username":"BigHornsBigKnives","quantity":5},{"user_id":336982,"username":"krook","quantity":4},{"user_id":1579867,"username":"deadmoney6","quantity":1}],"monthly_leaderboard":[{"user_id":33225,"username":"MRQUICK666","quantity":10},{"user_id":8696811,"username":"Nate09","quantity":10},{"user_id":8561504,"username":"ridorana12","quantity":7},{"user_id":11837402,"username":"BigHornsBigKnives","quantity":5},{"user_id":4239451,"username":"Slippy151","quantity":5},{"user_id":48392334,"username":"isokeith","quantity":5},{"user_id":4341321,"username":"Stonkzz","quantity":5},{"user_id":16894707,"username":"Turtle427","quantity":5},{"user_id":336982,"username":"krook","quantity":4},{"user_id":76184,"username":"complicated","quantity":2}],"gifter_id":11837402,"gifter_username":"BigHornsBigKnives","gifted_quantity":5}
|
|
476
|
+
GiftsLeaderboardUpdated: {
|
|
477
|
+
leaderboard: {
|
|
478
|
+
user_id: number;
|
|
479
|
+
username: string;
|
|
480
|
+
quantity: number;
|
|
481
|
+
}[];
|
|
482
|
+
weekly_leaderboard: {
|
|
483
|
+
user_id: number;
|
|
484
|
+
username: string;
|
|
485
|
+
quantity: number;
|
|
486
|
+
}[];
|
|
487
|
+
monthly_leaderboard: {
|
|
488
|
+
user_id: number;
|
|
489
|
+
username: string;
|
|
490
|
+
quantity: number;
|
|
491
|
+
}[];
|
|
492
|
+
gifter_id: number;
|
|
493
|
+
gifter_username: string;
|
|
494
|
+
gifted_quantity: number;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
// {"channel":{"id":145224,"user_id":146923,"slug":"iceposeidon","is_banned":false,"playback_url":"https://fa723fc1b171.us-west-2.playback.live-video.net/api/video/v1/us-west-2.196233775518.channel.aAMMC00nhtv0.m3u8","name_updated_at":null,"vod_enabled":true,"subscription_enabled":true,"is_affiliate":false,"can_host":true,"chatroom":{"id":145222,"chatable_type":"App\\Models\\Channel","channel_id":145224,"created_at":"2022-12-07T04:42:13.000000Z","updated_at":"2025-02-01T03:27:53.000000Z","chat_mode_old":"public","chat_mode":"public","slow_mode":true,"chatable_id":145224,"followers_mode":true,"subscribers_mode":false,"emotes_mode":false,"message_interval":3,"following_min_duration":6}},"usernames":["Burger2","zigi36","Tallstack","redbug","Real_TOMMO"],"gifter_username":"BigHornsBigKnives"}
|
|
498
|
+
LuckyUsersWhoGotGiftSubscriptionsEvent: {
|
|
499
|
+
channel: {
|
|
500
|
+
id: number;
|
|
501
|
+
user_id: number;
|
|
502
|
+
slug: string;
|
|
503
|
+
is_banned: boolean;
|
|
504
|
+
playback_url: string;
|
|
505
|
+
name_updated_at: unknown;
|
|
506
|
+
vod_enabled: boolean;
|
|
507
|
+
subscription_enabled: boolean;
|
|
508
|
+
is_affiliate: boolean;
|
|
509
|
+
can_host: boolean;
|
|
510
|
+
chatroom: {
|
|
511
|
+
id: number;
|
|
512
|
+
chatable_type: string;
|
|
513
|
+
channel_id: number;
|
|
514
|
+
created_at: string;
|
|
515
|
+
updated_at: string;
|
|
516
|
+
chat_mode_old: string;
|
|
517
|
+
chat_mode: string;
|
|
518
|
+
slow_mode: boolean;
|
|
519
|
+
chatable_id: number;
|
|
520
|
+
followers_mode: boolean;
|
|
521
|
+
subscribers_mode: boolean;
|
|
522
|
+
emotes_mode: boolean;
|
|
523
|
+
message_interval: number;
|
|
524
|
+
following_min_duration: number;
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
usernames: string[];
|
|
528
|
+
gifter_username: string;
|
|
529
|
+
};
|
|
460
530
|
}
|
|
461
531
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
532
|
+
export interface ChatroomsV1Events {
|
|
533
|
+
// {"message":{"id":"3ff9babe-b8ec-468b-aba8-f5c76986e254","numberOfViewers":1877,"optionalMessage":"","createdAt":"2025-02-10T12:03:55.204926Z"},"user":{"id":278343,"username":"Mando","isSuperAdmin":false,"verified":{"id":4867,"channel_id":275681,"created_at":"2023-11-17T20:31:43.000000Z","updated_at":"2023-11-17T20:31:43.000000Z"}}}
|
|
534
|
+
StreamHostedEvent: {
|
|
535
|
+
message: {
|
|
536
|
+
createdAt: string;
|
|
537
|
+
id: string;
|
|
538
|
+
numberOfViewers: number;
|
|
539
|
+
optionalMessage: string;
|
|
540
|
+
};
|
|
541
|
+
user: {
|
|
542
|
+
id: number;
|
|
543
|
+
isSuperAdmin: boolean;
|
|
544
|
+
username: string;
|
|
545
|
+
verified: {
|
|
546
|
+
id: number;
|
|
547
|
+
channel_id: number;
|
|
548
|
+
created_at: string;
|
|
549
|
+
updated_at: string;
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
// [message deletion event] unavailable in v1
|
|
555
|
+
|
|
556
|
+
// [user ban event] unavailable in v1
|
|
557
|
+
|
|
558
|
+
// {"message":{"id":"9b81e836-dfda-4824-87e3-d92e036c65d4","message":null,"type":"info","replied_to":null,"is_info":null,"link_preview":null,"chatroom_id":145222,"role":"user","created_at":1739184786,"action":"subscribe","optional_message":null,"months_subscribed":9,"subscriptions_count":0,"giftedUsers":null},"user":{"id":262477,"username":"Biceus","role":"user","isSuperAdmin":null,"profile_thumb":"https://kick-files-prod.s3.us-west-2.amazonaws.com/images/user/262477/profile_image/conversion/bdb5086d-8a01-457b-bd90-6ff2f4bfabe1-thumb.webp?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAS3MDRZGPDOOAYROR%2F20250210%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20250210T105306Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=5740ccf2430c6b68c04fc38ff06ed47d4785f7c52b0f3855903f184bded22de4","verified":false,"follower_badges":[],"is_subscribed":null,"is_founder":false,"months_subscribed":9,"quantity_gifted":0}}
|
|
559
|
+
ChatMessageSentEvent: {
|
|
560
|
+
message: {
|
|
561
|
+
action: 'subscribe' | 'gift';
|
|
562
|
+
chatroom_id: number;
|
|
563
|
+
created_at: number;
|
|
564
|
+
giftedUsers: {
|
|
565
|
+
username: string;
|
|
566
|
+
monthsSubscribed: number;
|
|
567
|
+
}[];
|
|
568
|
+
id: string;
|
|
569
|
+
is_info: unknown;
|
|
570
|
+
link_preview: unknown;
|
|
571
|
+
message: unknown;
|
|
572
|
+
months_subscribed: number | null;
|
|
573
|
+
optional_message: unknown;
|
|
574
|
+
replied_to: unknown;
|
|
575
|
+
role: 'user';
|
|
576
|
+
subscriptions_count: number;
|
|
577
|
+
type: 'info';
|
|
578
|
+
};
|
|
579
|
+
user: {
|
|
580
|
+
follower_badges: unknown[];
|
|
581
|
+
id: number;
|
|
582
|
+
isSuperAdmin: boolean;
|
|
583
|
+
is_founder: boolean;
|
|
584
|
+
is_subscribed: unknown;
|
|
585
|
+
months_subscribed: number;
|
|
586
|
+
profile_thumb: string;
|
|
587
|
+
quantity_gifted: number;
|
|
588
|
+
role: 'user';
|
|
589
|
+
username: string;
|
|
590
|
+
verified: boolean;
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export interface ChatroomV1Events {
|
|
596
|
+
// {"chatroom_id":145222,"gifted_usernames":["Burger2","Real_TOMMO","Tallstack","zigi36","redbug"],"gifter_username":"BigHornsBigKnives","gifter_total":5}
|
|
597
|
+
GiftedSubscriptionsEvent: {
|
|
598
|
+
chatroom_id: number;
|
|
599
|
+
gifted_usernames: string[];
|
|
600
|
+
gifter_total: number;
|
|
601
|
+
gifter_username: string;
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export interface ChatroomsV2Events {
|
|
606
|
+
// {"chatroom_id":145222,"optional_message":"","number_viewers":1877,"host_username":"Mando"}
|
|
607
|
+
StreamHostEvent: {
|
|
608
|
+
chatroom_id: number;
|
|
609
|
+
optional_message: string;
|
|
610
|
+
number_viewers: number;
|
|
611
|
+
host_username: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
// {"id":"3b03e221-480a-4c2c-bc65-61573d3336d9","message":{"id":"499500b9-ea91-467f-9034-9eee6e6e164a"},"aiModerated":false,"violatedRules":[]}
|
|
615
|
+
MessageDeletedEvent: {
|
|
616
|
+
id: string;
|
|
617
|
+
message: {
|
|
618
|
+
id: string;
|
|
619
|
+
};
|
|
620
|
+
aiModerated: boolean;
|
|
621
|
+
violatedRules: unknown[];
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
// {"id":"6b937ce4-dcc6-4fdf-a113-7c115e5443b1","user":{"id":24580921,"username":"helpinghand","slug":"helpinghand"},"banned_by":{"id":0,"username":"BotRix","slug":"botrix"},"permanent":false,"duration":1,"expires_at":"2025-02-10T12:19:11+00:00"}
|
|
625
|
+
UserBannedEvent: {
|
|
626
|
+
id: string;
|
|
627
|
+
user: {
|
|
628
|
+
id: number;
|
|
629
|
+
username: string;
|
|
630
|
+
slug: string;
|
|
631
|
+
};
|
|
632
|
+
banned_by: {
|
|
633
|
+
id: number;
|
|
634
|
+
username: string;
|
|
635
|
+
slug: string;
|
|
636
|
+
};
|
|
637
|
+
permanent: boolean;
|
|
638
|
+
duration: number;
|
|
639
|
+
expires_at: string;
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
// {"chatroom_id":145222,"username":"Biceus","months":9}
|
|
643
|
+
SubscriptionEvent: {
|
|
644
|
+
chatroom_id: number;
|
|
645
|
+
username: string;
|
|
646
|
+
months: number;
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
ChatMessageEvent: {
|
|
650
|
+
id: string;
|
|
651
|
+
chatroom_id: number;
|
|
652
|
+
content: string;
|
|
653
|
+
type: 'message' | 'celebration';
|
|
654
|
+
created_at: string;
|
|
655
|
+
metadata?: {
|
|
656
|
+
celebration: {
|
|
657
|
+
created_at: string;
|
|
658
|
+
id: string;
|
|
659
|
+
total_months: number;
|
|
660
|
+
type: 'subscription_renewed';
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
sender: {
|
|
664
|
+
id: number;
|
|
665
|
+
username: string;
|
|
666
|
+
slug?: string;
|
|
667
|
+
identity: {
|
|
668
|
+
color: string;
|
|
669
|
+
badges: Array<{
|
|
670
|
+
type: string;
|
|
671
|
+
text: string;
|
|
672
|
+
count?: number;
|
|
673
|
+
}>;
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
};
|
|
466
677
|
}
|
package/dist/default/kick.d.ts
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import Pusher from 'pusher-js';
|
|
2
|
-
import { type BadgeURLsByNameOrCount, type EmoteURLsByName, type Message } from './index.js';
|
|
3
|
-
type ConnectionState = 'initialized' | 'connecting' | 'connected' | 'unavailable' | 'failed';
|
|
4
|
-
type ConnectionStateEvent = {
|
|
5
|
-
previous: ConnectionState;
|
|
6
|
-
current: ConnectionState;
|
|
7
|
-
};
|
|
8
|
-
type EventCallbackFunctions = {
|
|
9
|
-
message: (message: Message) => unknown;
|
|
10
|
-
subscription: (data: ChatSubscriptionEvent) => unknown;
|
|
11
|
-
gifted: (data: ChatGiftedEvent) => unknown;
|
|
12
|
-
raw_message: (message: ChatMessageEvent) => unknown;
|
|
13
|
-
connection_state_changed: (state: ConnectionStateEvent) => unknown;
|
|
14
|
-
};
|
|
15
|
-
type EventNames = keyof EventCallbackFunctions;
|
|
16
|
-
export declare class KickPusher {
|
|
17
|
-
kick_pusher_key: string;
|
|
18
|
-
channel_name?: string;
|
|
19
|
-
private assets;
|
|
20
|
-
private public_listeners;
|
|
21
|
-
socket?: Pusher;
|
|
22
|
-
isConnected: boolean;
|
|
23
|
-
setBadges(badges: BadgeURLsByNameOrCount): void;
|
|
24
|
-
setExternalEmotes(external_emotes: EmoteURLsByName): void;
|
|
25
|
-
getStoredBadges(): BadgeURLsByNameOrCount;
|
|
26
|
-
getStoredExternalEmotes(): EmoteURLsByName;
|
|
27
|
-
connect(channel?: {
|
|
28
|
-
channelName?: string;
|
|
29
|
-
}, get_channel?: (channelName: string) => Promise<GetChannelResponse | undefined>): Promise<void>;
|
|
30
|
-
disconnect(): void;
|
|
31
|
-
on<EventName extends EventNames>(event_name: EventName, callback_fn: EventCallbackFunctions[EventName]): void;
|
|
32
|
-
private onSubscriptionSuccess;
|
|
33
|
-
private onChatSubscription;
|
|
34
|
-
private onChatGifted;
|
|
35
|
-
private onChatMessage;
|
|
36
|
-
}
|
|
37
|
-
export interface GetChannelResponse {
|
|
38
|
-
id: number;
|
|
39
|
-
user_id: number;
|
|
40
|
-
slug: string;
|
|
41
|
-
is_banned: boolean;
|
|
42
|
-
playback_url?: string;
|
|
43
|
-
vod_enabled: boolean;
|
|
44
|
-
subscription_enabled: boolean;
|
|
45
|
-
followers_count: number;
|
|
46
|
-
following?: boolean;
|
|
47
|
-
subscription?: unknown;
|
|
48
|
-
subscriber_badges: Array<{
|
|
49
|
-
id: number;
|
|
50
|
-
channel_id: number;
|
|
51
|
-
months: number;
|
|
52
|
-
badge_image: {
|
|
53
|
-
srcset: string;
|
|
54
|
-
src: string;
|
|
55
|
-
};
|
|
56
|
-
}>;
|
|
57
|
-
banner_image?: {
|
|
58
|
-
url: string;
|
|
59
|
-
};
|
|
60
|
-
livestream?: ChannelLivestream;
|
|
61
|
-
role?: unknown;
|
|
62
|
-
muted: boolean;
|
|
63
|
-
follower_badges: unknown[];
|
|
64
|
-
offline_banner_image: unknown;
|
|
65
|
-
verified: boolean;
|
|
66
|
-
recent_categories: Array<{
|
|
67
|
-
id: number;
|
|
68
|
-
category_id: number;
|
|
69
|
-
name: string;
|
|
70
|
-
slug: string;
|
|
71
|
-
tags: string[];
|
|
72
|
-
description?: string;
|
|
73
|
-
deleted_at: unknown;
|
|
74
|
-
viewers: number;
|
|
75
|
-
banner: {
|
|
76
|
-
responsive: string;
|
|
77
|
-
url: string;
|
|
78
|
-
};
|
|
79
|
-
category: {
|
|
80
|
-
id: number;
|
|
81
|
-
name: string;
|
|
82
|
-
slug: string;
|
|
83
|
-
icon: string;
|
|
84
|
-
};
|
|
85
|
-
}>;
|
|
86
|
-
can_host: boolean;
|
|
87
|
-
user: {
|
|
88
|
-
id: number;
|
|
89
|
-
username: string;
|
|
90
|
-
agreed_to_terms: true;
|
|
91
|
-
email_verified_at: Date;
|
|
92
|
-
bio?: string;
|
|
93
|
-
country?: string;
|
|
94
|
-
state?: string;
|
|
95
|
-
city?: string;
|
|
96
|
-
instagram?: string;
|
|
97
|
-
twitter?: string;
|
|
98
|
-
youtube?: string;
|
|
99
|
-
discord?: string;
|
|
100
|
-
tiktok?: string;
|
|
101
|
-
facebook?: string;
|
|
102
|
-
profile_pic?: string;
|
|
103
|
-
};
|
|
104
|
-
chatroom: ChannelChatroom;
|
|
105
|
-
ascending_links?: Array<{
|
|
106
|
-
id: number;
|
|
107
|
-
channel_id: number;
|
|
108
|
-
description: string;
|
|
109
|
-
link: string;
|
|
110
|
-
created_at: Date;
|
|
111
|
-
updated_at: Date;
|
|
112
|
-
order: number;
|
|
113
|
-
title: string;
|
|
114
|
-
}>;
|
|
115
|
-
}
|
|
116
|
-
export interface ChannelLivestream {
|
|
117
|
-
id: number;
|
|
118
|
-
slug: string;
|
|
119
|
-
channel_id: number;
|
|
120
|
-
created_at: Date;
|
|
121
|
-
session_title: string;
|
|
122
|
-
is_live: boolean;
|
|
123
|
-
risk_level_id: unknown;
|
|
124
|
-
start_time: Date;
|
|
125
|
-
source: unknown;
|
|
126
|
-
twitch_channel: unknown;
|
|
127
|
-
duration: number;
|
|
128
|
-
language: string;
|
|
129
|
-
is_mature: boolean;
|
|
130
|
-
viewer_count: number;
|
|
131
|
-
thumbnail: {
|
|
132
|
-
url: string;
|
|
133
|
-
};
|
|
134
|
-
categories: Array<{
|
|
135
|
-
id: number;
|
|
136
|
-
category_id: number;
|
|
137
|
-
name: string;
|
|
138
|
-
slug: string;
|
|
139
|
-
tags: string[];
|
|
140
|
-
description?: string;
|
|
141
|
-
deleted_at: unknown;
|
|
142
|
-
viewers: number;
|
|
143
|
-
category: {
|
|
144
|
-
id: number;
|
|
145
|
-
name: string;
|
|
146
|
-
slug: string;
|
|
147
|
-
icon: string;
|
|
148
|
-
};
|
|
149
|
-
}>;
|
|
150
|
-
tags: unknown[];
|
|
151
|
-
}
|
|
152
|
-
export interface ChannelChatroom {
|
|
153
|
-
id: number;
|
|
154
|
-
chatable_type: string;
|
|
155
|
-
channel_id: string;
|
|
156
|
-
created_at: Date;
|
|
157
|
-
updated_at: Date;
|
|
158
|
-
chat_mode_old: string;
|
|
159
|
-
chat_mode: string;
|
|
160
|
-
slow_mode: boolean;
|
|
161
|
-
chatable_id: number;
|
|
162
|
-
followers_mode: boolean;
|
|
163
|
-
subscribers_mode: boolean;
|
|
164
|
-
emotes_mode: boolean;
|
|
165
|
-
message_interval: number;
|
|
166
|
-
following_min_duration: number;
|
|
167
|
-
}
|
|
168
|
-
export interface ChatMessageEvent {
|
|
169
|
-
id: string;
|
|
170
|
-
chatroom_id: number;
|
|
171
|
-
content: string;
|
|
172
|
-
type: 'message' | 'celebration';
|
|
173
|
-
created_at: string;
|
|
174
|
-
metadata?: {
|
|
175
|
-
celebration: {
|
|
176
|
-
created_at: string;
|
|
177
|
-
id: string;
|
|
178
|
-
total_months: number;
|
|
179
|
-
type: 'subscription_renewed';
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
sender: {
|
|
183
|
-
id: number;
|
|
184
|
-
username: string;
|
|
185
|
-
slug?: string;
|
|
186
|
-
identity: {
|
|
187
|
-
color: string;
|
|
188
|
-
badges: Array<{
|
|
189
|
-
type: string;
|
|
190
|
-
text: string;
|
|
191
|
-
count?: number;
|
|
192
|
-
}>;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
export interface ChatSubscriptionEvent {
|
|
197
|
-
chatroom_id: string;
|
|
198
|
-
username: string;
|
|
199
|
-
months: number;
|
|
200
|
-
}
|
|
201
|
-
export interface ChatGiftedEvent {
|
|
202
|
-
chatroom_id: string;
|
|
203
|
-
gifted_usernames: string[];
|
|
204
|
-
gifter_username: string;
|
|
205
|
-
}
|
|
206
|
-
export {};
|
package/dist/worker/index.d.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
export * from './kick.js';
|
|
2
|
-
export * from './twitch.js';
|
|
3
|
-
export type Message = {
|
|
4
|
-
body: BodyComponent[];
|
|
5
|
-
channel: {
|
|
6
|
-
room_id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
id: string;
|
|
10
|
-
raw_text: string;
|
|
11
|
-
timestamp_sent: number;
|
|
12
|
-
resubscription?: {
|
|
13
|
-
id: string;
|
|
14
|
-
months: number;
|
|
15
|
-
subscribed_since_timestamp: string;
|
|
16
|
-
};
|
|
17
|
-
user: {
|
|
18
|
-
badges: Badge[];
|
|
19
|
-
color: string;
|
|
20
|
-
id: string;
|
|
21
|
-
username: string;
|
|
22
|
-
display_name: string;
|
|
23
|
-
roles: {
|
|
24
|
-
[role in 'vip' | 'moderator' | 'turbo' | 'admin' | 'global_moderator' | 'staff']?: boolean;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export type ClearMessages = {
|
|
29
|
-
channel: {
|
|
30
|
-
room_id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
};
|
|
33
|
-
user?: {
|
|
34
|
-
id: string;
|
|
35
|
-
username: string;
|
|
36
|
-
};
|
|
37
|
-
timeout_duration_seconds?: number | undefined;
|
|
38
|
-
timestamp_sent: number;
|
|
39
|
-
};
|
|
40
|
-
export type DeleteMessage = {
|
|
41
|
-
channel: {
|
|
42
|
-
room_id?: string;
|
|
43
|
-
name: string;
|
|
44
|
-
};
|
|
45
|
-
user?: {
|
|
46
|
-
username: string;
|
|
47
|
-
};
|
|
48
|
-
id: string;
|
|
49
|
-
raw_text: string;
|
|
50
|
-
timestamp_sent: number;
|
|
51
|
-
};
|
|
52
|
-
type EventData = {
|
|
53
|
-
subscription: {
|
|
54
|
-
months: number;
|
|
55
|
-
streak?: number;
|
|
56
|
-
subscription_plan: {
|
|
57
|
-
type: 'prime' | 1000 | 2000 | 3000;
|
|
58
|
-
name: string;
|
|
59
|
-
};
|
|
60
|
-
gift_upgrade?: {
|
|
61
|
-
gift_total: number;
|
|
62
|
-
promo_name: string;
|
|
63
|
-
sender: {
|
|
64
|
-
username: string;
|
|
65
|
-
display_name: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
gift: {
|
|
70
|
-
months: number;
|
|
71
|
-
recipient: {
|
|
72
|
-
id: string;
|
|
73
|
-
username: string;
|
|
74
|
-
display_name: string;
|
|
75
|
-
};
|
|
76
|
-
subscription_plan: {
|
|
77
|
-
type: 'prime' | 1000 | 2000 | 3000;
|
|
78
|
-
name: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
raid: {
|
|
82
|
-
sender: {
|
|
83
|
-
username: string;
|
|
84
|
-
display_name: string;
|
|
85
|
-
viewer_count: number;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export type Event = {
|
|
90
|
-
[E in keyof EventData]: {
|
|
91
|
-
type: E;
|
|
92
|
-
body: BodyComponent[];
|
|
93
|
-
channel: {
|
|
94
|
-
room_id: string;
|
|
95
|
-
name: string;
|
|
96
|
-
};
|
|
97
|
-
id: string;
|
|
98
|
-
raw_text: string;
|
|
99
|
-
system_message: string;
|
|
100
|
-
timestamp_sent: number;
|
|
101
|
-
user: {
|
|
102
|
-
badges: Badge[];
|
|
103
|
-
color: string;
|
|
104
|
-
id: string;
|
|
105
|
-
username: string;
|
|
106
|
-
display_name: string;
|
|
107
|
-
roles: {
|
|
108
|
-
[role in 'moderator' | 'subscriber' | 'turbo' | 'admin' | 'global_moderator' | 'staff']?: boolean;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
data: EventData[E];
|
|
112
|
-
};
|
|
113
|
-
}[keyof EventData];
|
|
114
|
-
export type BodyComponentEmote = {
|
|
115
|
-
end_exclusive: number;
|
|
116
|
-
start_inclusive: number;
|
|
117
|
-
type: 'emote';
|
|
118
|
-
url: string;
|
|
119
|
-
};
|
|
120
|
-
export type BodyComponent = {
|
|
121
|
-
end_exclusive: number;
|
|
122
|
-
label: string;
|
|
123
|
-
start_inclusive: number;
|
|
124
|
-
type: 'link';
|
|
125
|
-
url: string;
|
|
126
|
-
} | {
|
|
127
|
-
end_exclusive: number;
|
|
128
|
-
start_inclusive: number;
|
|
129
|
-
text: string;
|
|
130
|
-
type: 'text';
|
|
131
|
-
} | BodyComponentEmote;
|
|
132
|
-
type Badge = {
|
|
133
|
-
info?: string | undefined;
|
|
134
|
-
set_id: string;
|
|
135
|
-
url: string;
|
|
136
|
-
};
|
|
137
|
-
export type BadgeURLsByNameOrCount = {
|
|
138
|
-
[badge_name: string]: string | {
|
|
139
|
-
[badge_count: number]: string;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
export type BadgeURLsBySetIDOrSetIDAndVersion = {
|
|
143
|
-
[set_id: string]: {
|
|
144
|
-
[version: string]: string;
|
|
145
|
-
} | string;
|
|
146
|
-
};
|
|
147
|
-
export type EmoteURLsByName = {
|
|
148
|
-
[emote_name: string]: string;
|
|
149
|
-
};
|
package/dist/worker/index.js
DELETED