multichat-ts 0.0.93 → 0.0.94
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/.prettierrc +7 -7
- package/dist/kick.js +1 -1
- package/package.json +1 -1
- package/src/default/index.ts +173 -173
- package/src/default/kick.ts +676 -676
package/.prettierrc
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"useTabs": true,
|
|
3
|
-
"singleQuote": true,
|
|
4
|
-
"semi": true,
|
|
5
|
-
"trailingComma": "all",
|
|
6
|
-
"printWidth": 100
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"useTabs": true,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"semi": true,
|
|
5
|
+
"trailingComma": "all",
|
|
6
|
+
"printWidth": 100
|
|
7
|
+
}
|
package/dist/kick.js
CHANGED
|
@@ -121,7 +121,7 @@ export class KickPusher {
|
|
|
121
121
|
onChatMessage(data) {
|
|
122
122
|
this.public_listeners.raw_message?.(data);
|
|
123
123
|
const text = data.content;
|
|
124
|
-
const emote_matches = [...data.content.matchAll(/\[emote:\d
|
|
124
|
+
const emote_matches = [...data.content.matchAll(/\[emote:\d+:.+\]/g)];
|
|
125
125
|
const body = [];
|
|
126
126
|
emote_matches.forEach((match) => {
|
|
127
127
|
const emote_string = match[0];
|
package/package.json
CHANGED
package/src/default/index.ts
CHANGED
|
@@ -1,173 +1,173 @@
|
|
|
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
|
-
resubscription?: {
|
|
14
|
-
id: string;
|
|
15
|
-
months: number;
|
|
16
|
-
subscribed_since_timestamp: string;
|
|
17
|
-
};
|
|
18
|
-
user: {
|
|
19
|
-
badges: Badge[];
|
|
20
|
-
color: string;
|
|
21
|
-
id: string;
|
|
22
|
-
username: string;
|
|
23
|
-
display_name: string;
|
|
24
|
-
roles: {
|
|
25
|
-
[role in 'vip' | 'moderator' | 'turbo' | 'admin' | 'global_moderator' | 'staff']?: boolean;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type ClearMessages = {
|
|
31
|
-
channel: {
|
|
32
|
-
room_id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
35
|
-
user?: {
|
|
36
|
-
id: string;
|
|
37
|
-
username: string;
|
|
38
|
-
};
|
|
39
|
-
timeout_duration_seconds?: number | undefined;
|
|
40
|
-
timestamp_sent: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type DeleteMessage = {
|
|
44
|
-
channel: {
|
|
45
|
-
room_id?: string;
|
|
46
|
-
name: string;
|
|
47
|
-
};
|
|
48
|
-
user?: {
|
|
49
|
-
username: string;
|
|
50
|
-
};
|
|
51
|
-
id: string;
|
|
52
|
-
raw_text: string;
|
|
53
|
-
timestamp_sent: number;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
type EventData = {
|
|
57
|
-
subscription: {
|
|
58
|
-
months: number;
|
|
59
|
-
streak?: number;
|
|
60
|
-
subscription_plan: {
|
|
61
|
-
type: 'prime' | 1000 | 2000 | 3000;
|
|
62
|
-
name: string;
|
|
63
|
-
};
|
|
64
|
-
gift_upgrade?: {
|
|
65
|
-
gift_total: number;
|
|
66
|
-
promo_name: string;
|
|
67
|
-
sender: {
|
|
68
|
-
username: string;
|
|
69
|
-
display_name: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
gift: {
|
|
74
|
-
months: number;
|
|
75
|
-
recipient: {
|
|
76
|
-
id: string;
|
|
77
|
-
username: string;
|
|
78
|
-
display_name: string;
|
|
79
|
-
};
|
|
80
|
-
subscription_plan: {
|
|
81
|
-
type: 'prime' | 1000 | 2000 | 3000;
|
|
82
|
-
name: string;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
raid: {
|
|
86
|
-
sender: {
|
|
87
|
-
username: string;
|
|
88
|
-
display_name: string;
|
|
89
|
-
viewer_count: number;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export type Event = {
|
|
95
|
-
[E in keyof EventData]: {
|
|
96
|
-
type: E;
|
|
97
|
-
body: BodyComponent[];
|
|
98
|
-
channel: {
|
|
99
|
-
room_id: string;
|
|
100
|
-
name: string;
|
|
101
|
-
};
|
|
102
|
-
id: string;
|
|
103
|
-
raw_text: string;
|
|
104
|
-
system_message: string;
|
|
105
|
-
timestamp_sent: number;
|
|
106
|
-
user: {
|
|
107
|
-
badges: Badge[];
|
|
108
|
-
color: string;
|
|
109
|
-
id: string;
|
|
110
|
-
username: string;
|
|
111
|
-
display_name: string;
|
|
112
|
-
roles: {
|
|
113
|
-
[role in
|
|
114
|
-
| 'moderator'
|
|
115
|
-
| 'subscriber'
|
|
116
|
-
| 'turbo'
|
|
117
|
-
| 'admin'
|
|
118
|
-
| 'global_moderator'
|
|
119
|
-
| 'staff']?: boolean;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
data: EventData[E];
|
|
123
|
-
};
|
|
124
|
-
}[keyof EventData];
|
|
125
|
-
|
|
126
|
-
export type BodyComponentEmote = {
|
|
127
|
-
end_exclusive: number;
|
|
128
|
-
start_inclusive: number;
|
|
129
|
-
type: 'emote';
|
|
130
|
-
url: string;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export type BodyComponent =
|
|
134
|
-
| {
|
|
135
|
-
end_exclusive: number;
|
|
136
|
-
label: string;
|
|
137
|
-
start_inclusive: number;
|
|
138
|
-
type: 'link';
|
|
139
|
-
url: string;
|
|
140
|
-
}
|
|
141
|
-
| {
|
|
142
|
-
end_exclusive: number;
|
|
143
|
-
start_inclusive: number;
|
|
144
|
-
text: string;
|
|
145
|
-
type: 'text';
|
|
146
|
-
}
|
|
147
|
-
| BodyComponentEmote;
|
|
148
|
-
|
|
149
|
-
type Badge = {
|
|
150
|
-
info?: string | undefined;
|
|
151
|
-
set_id: string;
|
|
152
|
-
url: string;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export type BadgeURLsByNameOrCount = {
|
|
156
|
-
[badge_name: string]:
|
|
157
|
-
| string
|
|
158
|
-
| {
|
|
159
|
-
[badge_count: number]: string;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export type BadgeURLsBySetIDOrSetIDAndVersion = {
|
|
164
|
-
[set_id: string]:
|
|
165
|
-
| {
|
|
166
|
-
[version: string]: string;
|
|
167
|
-
}
|
|
168
|
-
| string;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export type EmoteURLsByName = {
|
|
172
|
-
[emote_name: string]: string;
|
|
173
|
-
};
|
|
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
|
+
resubscription?: {
|
|
14
|
+
id: string;
|
|
15
|
+
months: number;
|
|
16
|
+
subscribed_since_timestamp: string;
|
|
17
|
+
};
|
|
18
|
+
user: {
|
|
19
|
+
badges: Badge[];
|
|
20
|
+
color: string;
|
|
21
|
+
id: string;
|
|
22
|
+
username: string;
|
|
23
|
+
display_name: string;
|
|
24
|
+
roles: {
|
|
25
|
+
[role in 'vip' | 'moderator' | 'turbo' | 'admin' | 'global_moderator' | 'staff']?: boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ClearMessages = {
|
|
31
|
+
channel: {
|
|
32
|
+
room_id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
user?: {
|
|
36
|
+
id: string;
|
|
37
|
+
username: string;
|
|
38
|
+
};
|
|
39
|
+
timeout_duration_seconds?: number | undefined;
|
|
40
|
+
timestamp_sent: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type DeleteMessage = {
|
|
44
|
+
channel: {
|
|
45
|
+
room_id?: string;
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
user?: {
|
|
49
|
+
username: string;
|
|
50
|
+
};
|
|
51
|
+
id: string;
|
|
52
|
+
raw_text: string;
|
|
53
|
+
timestamp_sent: number;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type EventData = {
|
|
57
|
+
subscription: {
|
|
58
|
+
months: number;
|
|
59
|
+
streak?: number;
|
|
60
|
+
subscription_plan: {
|
|
61
|
+
type: 'prime' | 1000 | 2000 | 3000;
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
gift_upgrade?: {
|
|
65
|
+
gift_total: number;
|
|
66
|
+
promo_name: string;
|
|
67
|
+
sender: {
|
|
68
|
+
username: string;
|
|
69
|
+
display_name: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
gift: {
|
|
74
|
+
months: number;
|
|
75
|
+
recipient: {
|
|
76
|
+
id: string;
|
|
77
|
+
username: string;
|
|
78
|
+
display_name: string;
|
|
79
|
+
};
|
|
80
|
+
subscription_plan: {
|
|
81
|
+
type: 'prime' | 1000 | 2000 | 3000;
|
|
82
|
+
name: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
raid: {
|
|
86
|
+
sender: {
|
|
87
|
+
username: string;
|
|
88
|
+
display_name: string;
|
|
89
|
+
viewer_count: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type Event = {
|
|
95
|
+
[E in keyof EventData]: {
|
|
96
|
+
type: E;
|
|
97
|
+
body: BodyComponent[];
|
|
98
|
+
channel: {
|
|
99
|
+
room_id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
};
|
|
102
|
+
id: string;
|
|
103
|
+
raw_text: string;
|
|
104
|
+
system_message: string;
|
|
105
|
+
timestamp_sent: number;
|
|
106
|
+
user: {
|
|
107
|
+
badges: Badge[];
|
|
108
|
+
color: string;
|
|
109
|
+
id: string;
|
|
110
|
+
username: string;
|
|
111
|
+
display_name: string;
|
|
112
|
+
roles: {
|
|
113
|
+
[role in
|
|
114
|
+
| 'moderator'
|
|
115
|
+
| 'subscriber'
|
|
116
|
+
| 'turbo'
|
|
117
|
+
| 'admin'
|
|
118
|
+
| 'global_moderator'
|
|
119
|
+
| 'staff']?: boolean;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
data: EventData[E];
|
|
123
|
+
};
|
|
124
|
+
}[keyof EventData];
|
|
125
|
+
|
|
126
|
+
export type BodyComponentEmote = {
|
|
127
|
+
end_exclusive: number;
|
|
128
|
+
start_inclusive: number;
|
|
129
|
+
type: 'emote';
|
|
130
|
+
url: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type BodyComponent =
|
|
134
|
+
| {
|
|
135
|
+
end_exclusive: number;
|
|
136
|
+
label: string;
|
|
137
|
+
start_inclusive: number;
|
|
138
|
+
type: 'link';
|
|
139
|
+
url: string;
|
|
140
|
+
}
|
|
141
|
+
| {
|
|
142
|
+
end_exclusive: number;
|
|
143
|
+
start_inclusive: number;
|
|
144
|
+
text: string;
|
|
145
|
+
type: 'text';
|
|
146
|
+
}
|
|
147
|
+
| BodyComponentEmote;
|
|
148
|
+
|
|
149
|
+
type Badge = {
|
|
150
|
+
info?: string | undefined;
|
|
151
|
+
set_id: string;
|
|
152
|
+
url: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export type BadgeURLsByNameOrCount = {
|
|
156
|
+
[badge_name: string]:
|
|
157
|
+
| string
|
|
158
|
+
| {
|
|
159
|
+
[badge_count: number]: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type BadgeURLsBySetIDOrSetIDAndVersion = {
|
|
164
|
+
[set_id: string]:
|
|
165
|
+
| {
|
|
166
|
+
[version: string]: string;
|
|
167
|
+
}
|
|
168
|
+
| string;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type EmoteURLsByName = {
|
|
172
|
+
[emote_name: string]: string;
|
|
173
|
+
};
|