multichat-ts 0.0.83 → 0.0.84
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/worker/kick.js +6 -1
- package/package.json +1 -1
- package/src/worker/index.ts +168 -168
- package/src/worker/kick.ts +417 -411
- package/src/worker/twitch.ts +540 -540
package/dist/worker/kick.js
CHANGED
|
@@ -43,7 +43,12 @@ export class KickPusher {
|
|
|
43
43
|
if (!this.channel_name)
|
|
44
44
|
return console.error('channel_name not specified');
|
|
45
45
|
console.log(`connecting to ${this.channel_name}...`);
|
|
46
|
-
const channel_response = await fetch(`https://kick.com/api/v2/channels/${this.channel_name}
|
|
46
|
+
const channel_response = await fetch(`https://kick.com/api/v2/channels/${this.channel_name}`, {
|
|
47
|
+
headers: {
|
|
48
|
+
accept: 'aplication/json',
|
|
49
|
+
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
47
52
|
.then((res) => res.json())
|
|
48
53
|
.then((json) => json);
|
|
49
54
|
if (!channel_response)
|
package/package.json
CHANGED
package/src/worker/index.ts
CHANGED
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
export * from './kick.js';
|
|
2
|
-
export * from './twitch.js';
|
|
3
|
-
|
|
4
|
-
export type Message = {
|
|
5
|
-
body: BodyComponent[];
|
|
6
|
-
channel: {
|
|
7
|
-
room_id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
id: string;
|
|
11
|
-
raw_text: string;
|
|
12
|
-
timestamp_sent: number;
|
|
13
|
-
user: {
|
|
14
|
-
badges: Badge[];
|
|
15
|
-
color: string;
|
|
16
|
-
id: string;
|
|
17
|
-
username: string;
|
|
18
|
-
display_name: string;
|
|
19
|
-
roles: {
|
|
20
|
-
[role in 'vip' | 'moderator' | 'turbo' | 'admin' | 'global_moderator' | 'staff']?: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type ClearMessages = {
|
|
26
|
-
channel: {
|
|
27
|
-
room_id: string;
|
|
28
|
-
name: string;
|
|
29
|
-
};
|
|
30
|
-
user?: {
|
|
31
|
-
id: string;
|
|
32
|
-
username: string;
|
|
33
|
-
};
|
|
34
|
-
timeout_duration_seconds?: number | undefined;
|
|
35
|
-
timestamp_sent: number;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type DeleteMessage = {
|
|
39
|
-
channel: {
|
|
40
|
-
room_id?: string;
|
|
41
|
-
name: string;
|
|
42
|
-
};
|
|
43
|
-
user?: {
|
|
44
|
-
username: string;
|
|
45
|
-
};
|
|
46
|
-
id: string;
|
|
47
|
-
raw_text: string;
|
|
48
|
-
timestamp_sent: number;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
type EventData = {
|
|
52
|
-
subscription: {
|
|
53
|
-
months: number;
|
|
54
|
-
streak?: number;
|
|
55
|
-
subscription_plan: {
|
|
56
|
-
type: 'prime' | 1000 | 2000 | 3000;
|
|
57
|
-
name: string;
|
|
58
|
-
};
|
|
59
|
-
gift_upgrade?: {
|
|
60
|
-
gift_total: number;
|
|
61
|
-
promo_name: string;
|
|
62
|
-
sender: {
|
|
63
|
-
username: string;
|
|
64
|
-
display_name: string;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
gift: {
|
|
69
|
-
months: number;
|
|
70
|
-
recipient: {
|
|
71
|
-
id: string;
|
|
72
|
-
username: string;
|
|
73
|
-
display_name: string;
|
|
74
|
-
};
|
|
75
|
-
subscription_plan: {
|
|
76
|
-
type: 'prime' | 1000 | 2000 | 3000;
|
|
77
|
-
name: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
raid: {
|
|
81
|
-
sender: {
|
|
82
|
-
username: string;
|
|
83
|
-
display_name: string;
|
|
84
|
-
viewer_count: number;
|
|
85
|
-
};
|
|
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
|
|
109
|
-
| 'moderator'
|
|
110
|
-
| 'subscriber'
|
|
111
|
-
| 'turbo'
|
|
112
|
-
| 'admin'
|
|
113
|
-
| 'global_moderator'
|
|
114
|
-
| 'staff']?: boolean;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
data: EventData[E];
|
|
118
|
-
};
|
|
119
|
-
}[keyof EventData];
|
|
120
|
-
|
|
121
|
-
export type BodyComponentEmote = {
|
|
122
|
-
end_exclusive: number;
|
|
123
|
-
start_inclusive: number;
|
|
124
|
-
type: 'emote';
|
|
125
|
-
url: string;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export type BodyComponent =
|
|
129
|
-
| {
|
|
130
|
-
end_exclusive: number;
|
|
131
|
-
label: string;
|
|
132
|
-
start_inclusive: number;
|
|
133
|
-
type: 'link';
|
|
134
|
-
url: string;
|
|
135
|
-
}
|
|
136
|
-
| {
|
|
137
|
-
end_exclusive: number;
|
|
138
|
-
start_inclusive: number;
|
|
139
|
-
text: string;
|
|
140
|
-
type: 'text';
|
|
141
|
-
}
|
|
142
|
-
| BodyComponentEmote;
|
|
143
|
-
|
|
144
|
-
type Badge = {
|
|
145
|
-
info?: string | undefined;
|
|
146
|
-
set_id: string;
|
|
147
|
-
url: string;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export type BadgeURLsByNameOrCount = {
|
|
151
|
-
[badge_name: string]:
|
|
152
|
-
| string
|
|
153
|
-
| {
|
|
154
|
-
[badge_count: number]: string;
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export type BadgeURLsBySetIDOrSetIDAndVersion = {
|
|
159
|
-
[set_id: string]:
|
|
160
|
-
| {
|
|
161
|
-
[version: string]: string;
|
|
162
|
-
}
|
|
163
|
-
| string;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export type EmoteURLsByName = {
|
|
167
|
-
[emote_name: string]: string;
|
|
168
|
-
};
|
|
1
|
+
export * from './kick.js';
|
|
2
|
+
export * from './twitch.js';
|
|
3
|
+
|
|
4
|
+
export type Message = {
|
|
5
|
+
body: BodyComponent[];
|
|
6
|
+
channel: {
|
|
7
|
+
room_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
id: string;
|
|
11
|
+
raw_text: string;
|
|
12
|
+
timestamp_sent: number;
|
|
13
|
+
user: {
|
|
14
|
+
badges: Badge[];
|
|
15
|
+
color: string;
|
|
16
|
+
id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
display_name: string;
|
|
19
|
+
roles: {
|
|
20
|
+
[role in 'vip' | 'moderator' | 'turbo' | 'admin' | 'global_moderator' | 'staff']?: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type ClearMessages = {
|
|
26
|
+
channel: {
|
|
27
|
+
room_id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
user?: {
|
|
31
|
+
id: string;
|
|
32
|
+
username: string;
|
|
33
|
+
};
|
|
34
|
+
timeout_duration_seconds?: number | undefined;
|
|
35
|
+
timestamp_sent: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type DeleteMessage = {
|
|
39
|
+
channel: {
|
|
40
|
+
room_id?: string;
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
user?: {
|
|
44
|
+
username: string;
|
|
45
|
+
};
|
|
46
|
+
id: string;
|
|
47
|
+
raw_text: string;
|
|
48
|
+
timestamp_sent: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type EventData = {
|
|
52
|
+
subscription: {
|
|
53
|
+
months: number;
|
|
54
|
+
streak?: number;
|
|
55
|
+
subscription_plan: {
|
|
56
|
+
type: 'prime' | 1000 | 2000 | 3000;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
gift_upgrade?: {
|
|
60
|
+
gift_total: number;
|
|
61
|
+
promo_name: string;
|
|
62
|
+
sender: {
|
|
63
|
+
username: string;
|
|
64
|
+
display_name: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
gift: {
|
|
69
|
+
months: number;
|
|
70
|
+
recipient: {
|
|
71
|
+
id: string;
|
|
72
|
+
username: string;
|
|
73
|
+
display_name: string;
|
|
74
|
+
};
|
|
75
|
+
subscription_plan: {
|
|
76
|
+
type: 'prime' | 1000 | 2000 | 3000;
|
|
77
|
+
name: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
raid: {
|
|
81
|
+
sender: {
|
|
82
|
+
username: string;
|
|
83
|
+
display_name: string;
|
|
84
|
+
viewer_count: number;
|
|
85
|
+
};
|
|
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
|
|
109
|
+
| 'moderator'
|
|
110
|
+
| 'subscriber'
|
|
111
|
+
| 'turbo'
|
|
112
|
+
| 'admin'
|
|
113
|
+
| 'global_moderator'
|
|
114
|
+
| 'staff']?: boolean;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
data: EventData[E];
|
|
118
|
+
};
|
|
119
|
+
}[keyof EventData];
|
|
120
|
+
|
|
121
|
+
export type BodyComponentEmote = {
|
|
122
|
+
end_exclusive: number;
|
|
123
|
+
start_inclusive: number;
|
|
124
|
+
type: 'emote';
|
|
125
|
+
url: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export type BodyComponent =
|
|
129
|
+
| {
|
|
130
|
+
end_exclusive: number;
|
|
131
|
+
label: string;
|
|
132
|
+
start_inclusive: number;
|
|
133
|
+
type: 'link';
|
|
134
|
+
url: string;
|
|
135
|
+
}
|
|
136
|
+
| {
|
|
137
|
+
end_exclusive: number;
|
|
138
|
+
start_inclusive: number;
|
|
139
|
+
text: string;
|
|
140
|
+
type: 'text';
|
|
141
|
+
}
|
|
142
|
+
| BodyComponentEmote;
|
|
143
|
+
|
|
144
|
+
type Badge = {
|
|
145
|
+
info?: string | undefined;
|
|
146
|
+
set_id: string;
|
|
147
|
+
url: string;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export type BadgeURLsByNameOrCount = {
|
|
151
|
+
[badge_name: string]:
|
|
152
|
+
| string
|
|
153
|
+
| {
|
|
154
|
+
[badge_count: number]: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type BadgeURLsBySetIDOrSetIDAndVersion = {
|
|
159
|
+
[set_id: string]:
|
|
160
|
+
| {
|
|
161
|
+
[version: string]: string;
|
|
162
|
+
}
|
|
163
|
+
| string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type EmoteURLsByName = {
|
|
167
|
+
[emote_name: string]: string;
|
|
168
|
+
};
|