@honeybbq/teamspeak-client 0.2.0 → 0.2.1
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/README.md +2 -2
- package/dist/handshake.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +96 -93
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "./types-CGKgXvpG.js";
|
|
2
|
-
import { C as r, S as i, _ as a, b as o, d as s, g as c, h as l, l as u, o as d, p as ee, r as f, u as p, v as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { a as
|
|
6
|
-
import { i as
|
|
7
|
-
import { n as
|
|
2
|
+
import { C as r, S as i, _ as a, b as o, d as s, g as c, h as l, l as u, o as d, p as ee, r as f, u as p, v as m, w as h, x as g, y as _ } from "./primitives-BIAYfJ2Y.js";
|
|
3
|
+
import { t as v } from "./crypto-VC7n6YJb.js";
|
|
4
|
+
import { t as y } from "./resolver-DDZWomrF.js";
|
|
5
|
+
import { a as b, t as x } from "./handler-C_JhqGTd.js";
|
|
6
|
+
import { i as S, n as C, t as w } from "./command-caXc4h0n.js";
|
|
7
|
+
import { n as te } from "./crypt-handshake-CHmvZ2qs.js";
|
|
8
8
|
import { t as T } from "./crypt-init2-DWX7Tp-_.js";
|
|
9
9
|
import { t as E } from "./parser-CJjP3LlO.js";
|
|
10
10
|
import { createHash as D } from "node:crypto";
|
|
@@ -118,7 +118,7 @@ async function F(e, t, n) {
|
|
|
118
118
|
}
|
|
119
119
|
function I(e, t, n, r, i, a) {
|
|
120
120
|
let o = t.startsWith("/") ? t : `/${t}`;
|
|
121
|
-
return
|
|
121
|
+
return w("ftinitupload", {
|
|
122
122
|
cid: String(e),
|
|
123
123
|
name: o,
|
|
124
124
|
cpw: n,
|
|
@@ -130,7 +130,7 @@ function I(e, t, n, r, i, a) {
|
|
|
130
130
|
}
|
|
131
131
|
function L(e, t, n, r) {
|
|
132
132
|
let i = t.startsWith("/") ? t : `/${t}`;
|
|
133
|
-
return
|
|
133
|
+
return w("ftinitdownload", {
|
|
134
134
|
cid: String(e),
|
|
135
135
|
name: i,
|
|
136
136
|
cpw: n,
|
|
@@ -154,17 +154,17 @@ function z(e, t) {
|
|
|
154
154
|
//#region src/handshake.ts
|
|
155
155
|
function B(e, t) {
|
|
156
156
|
let n = t.alpha ?? "", r = t.beta ?? "", i = t.omega ?? "";
|
|
157
|
-
e.crypt.initCrypto(n, r, i), e.logger.info("crypto initialized (P-256 path), sending clientinit"),
|
|
157
|
+
e.crypt.initCrypto(n, r, i), e.logger.info("crypto initialized (P-256 path), sending clientinit"), K(e);
|
|
158
158
|
}
|
|
159
159
|
function V(e, t) {
|
|
160
160
|
e.logger.info("received initivexpand2"), e.handler.receivedFinalInitAck();
|
|
161
161
|
let n = t.l ?? "", r = t.omega ?? "", i = t.proof ?? "", a = t.beta ?? "", o = U(e, a);
|
|
162
|
-
T(e.crypt, n, r, i, a, o),
|
|
162
|
+
T(e.crypt, n, r, i, a, o), K(e);
|
|
163
163
|
}
|
|
164
164
|
function H(e, t) {
|
|
165
165
|
let n = t.aclid ?? t.clid ?? "", r = n ? parseInt(n, 10) : 0;
|
|
166
166
|
r > 0 && (e.clid = r, e.handler.setClientID(r)), e.logger.info("connected to server", { selfId: e.clid }), e._markConnected(), setImmediate(() => {
|
|
167
|
-
let t =
|
|
167
|
+
let t = w("clientupdate", {
|
|
168
168
|
client_input_muted: "0",
|
|
169
169
|
client_output_muted: "0"
|
|
170
170
|
});
|
|
@@ -172,8 +172,8 @@ function H(e, t) {
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
function U(e, t) {
|
|
175
|
-
let [n, r] = f(), i = Buffer.from(n).toString("base64"), a = W(e, n, t), o =
|
|
176
|
-
return e.handler.sendPacket(
|
|
175
|
+
let [n, r] = f(), i = Buffer.from(n).toString("base64"), a = W(e, n, t), o = C("clientek", [["ek", i], ["proof", a]]);
|
|
176
|
+
return e.handler.sendPacket(b.Command, Buffer.from(o), 0), r;
|
|
177
177
|
}
|
|
178
178
|
function W(e, t, n) {
|
|
179
179
|
let r = Buffer.from(n, "base64"), i = new Uint8Array(86);
|
|
@@ -182,31 +182,34 @@ function W(e, t, n) {
|
|
|
182
182
|
return Buffer.from(a).toString("base64");
|
|
183
183
|
}
|
|
184
184
|
function G(e) {
|
|
185
|
-
|
|
186
|
-
e.handler.sendPacket(y.Command, Buffer.from(t), 0);
|
|
185
|
+
return e === "" ? "" : D("sha1").update(e).digest().toString("base64");
|
|
187
186
|
}
|
|
188
187
|
function K(e) {
|
|
189
|
-
let t =
|
|
190
|
-
|
|
188
|
+
let t = q(e);
|
|
189
|
+
e.handler.sendPacket(b.Command, Buffer.from(t), 0);
|
|
190
|
+
}
|
|
191
|
+
function q(e) {
|
|
192
|
+
let t = e.crypt.identity.publicKeyBase64(), n = e.getClientInitOptions(), r = G(n.defaultChannelPassword), i = G(n.serverPassword), a = D("sha1").update(t).digest().toString("base64");
|
|
193
|
+
return C("clientinit", [
|
|
191
194
|
["client_nickname", e.nickname],
|
|
192
195
|
["client_version", "3.?.? [Build: 5680278000]"],
|
|
193
196
|
["client_platform", "Windows"],
|
|
194
197
|
["client_input_hardware", "1"],
|
|
195
198
|
["client_output_hardware", "1"],
|
|
196
199
|
["client_default_channel", n.defaultChannel],
|
|
197
|
-
["client_default_channel_password",
|
|
198
|
-
["client_server_password",
|
|
200
|
+
["client_default_channel_password", r],
|
|
201
|
+
["client_server_password", i],
|
|
199
202
|
["client_meta_data", ""],
|
|
200
203
|
["client_version_sign", "DX5NIYLvfJEUjuIbCidnoeozxIDRRkpq3I9vVMBmE9L2qnekOoBzSenkzsg2lC9CMv8K5hkEzhr2TYUYSwUXCg=="],
|
|
201
204
|
["client_key_offset", String(e.crypt.identity.offset)],
|
|
202
205
|
["client_nickname_phonetic", ""],
|
|
203
206
|
["client_default_token", ""],
|
|
204
|
-
["hwid",
|
|
207
|
+
["hwid", a]
|
|
205
208
|
]);
|
|
206
209
|
}
|
|
207
210
|
//#endregion
|
|
208
211
|
//#region src/helpers.ts
|
|
209
|
-
function
|
|
212
|
+
function J(e) {
|
|
210
213
|
if (e === "" || e === void 0) return 0n;
|
|
211
214
|
try {
|
|
212
215
|
return BigInt(e);
|
|
@@ -214,21 +217,21 @@ function q(e) {
|
|
|
214
217
|
return 0n;
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
|
-
function
|
|
220
|
+
function Y(e) {
|
|
218
221
|
let t = parseInt(e, 10);
|
|
219
222
|
return isNaN(t) || t < 0 || t > 65535 ? 0 : t;
|
|
220
223
|
}
|
|
221
|
-
function
|
|
224
|
+
function X(e) {
|
|
222
225
|
let t = parseInt(e, 10);
|
|
223
226
|
return isNaN(t) ? 0 : t;
|
|
224
227
|
}
|
|
225
|
-
function
|
|
228
|
+
function Z(e, t) {
|
|
226
229
|
if (t === e) return !0;
|
|
227
230
|
if (!t.startsWith(e)) return !1;
|
|
228
231
|
let n = t.slice(e.length);
|
|
229
232
|
return /^\d+$/.test(n);
|
|
230
233
|
}
|
|
231
|
-
function
|
|
234
|
+
function Q(e) {
|
|
232
235
|
let t = e.indexOf(" ");
|
|
233
236
|
if (t < 0) return [e];
|
|
234
237
|
let n = e.slice(0, t), r = e.slice(t + 1);
|
|
@@ -239,30 +242,30 @@ function Z(e) {
|
|
|
239
242
|
}
|
|
240
243
|
//#endregion
|
|
241
244
|
//#region src/notifications.ts
|
|
242
|
-
function
|
|
245
|
+
function ne(e, t, n, r) {
|
|
243
246
|
switch (e.name) {
|
|
244
|
-
case "notifycliententerview": return
|
|
245
|
-
case "notifyclientleftview": return
|
|
246
|
-
case "notifyclientmoved": return
|
|
247
|
-
case "notifytextmessage": return
|
|
248
|
-
case "notifyclientpoke": return
|
|
247
|
+
case "notifycliententerview": return re(e, n, r);
|
|
248
|
+
case "notifyclientleftview": return ie(e, t, n);
|
|
249
|
+
case "notifyclientmoved": return ae(e, n);
|
|
250
|
+
case "notifytextmessage": return oe(e, n);
|
|
251
|
+
case "notifyclientpoke": return ue(e);
|
|
249
252
|
case "notifystartupload": return {
|
|
250
253
|
kind: "startUpload",
|
|
251
|
-
info:
|
|
254
|
+
info: se(e)
|
|
252
255
|
};
|
|
253
256
|
case "notifystartdownload": return {
|
|
254
257
|
kind: "startDownload",
|
|
255
|
-
info:
|
|
258
|
+
info: ce(e)
|
|
256
259
|
};
|
|
257
260
|
case "notifystatusfiletransfer": return {
|
|
258
261
|
kind: "fileTransferStatus",
|
|
259
|
-
info:
|
|
262
|
+
info: le(e)
|
|
260
263
|
};
|
|
261
264
|
default: return { kind: "unknown" };
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
|
-
function
|
|
265
|
-
let r =
|
|
267
|
+
function re(e, t, n) {
|
|
268
|
+
let r = Y(e.params.clid ?? ""), i = J(e.params.cid ?? ""), a = X(e.params.client_type ?? ""), o = e.params.client_servergroups ?? "", s = {
|
|
266
269
|
id: r,
|
|
267
270
|
nickname: e.params.client_nickname ?? "",
|
|
268
271
|
uid: e.params.client_unique_identifier ?? "",
|
|
@@ -275,21 +278,21 @@ function ne(e, t, n) {
|
|
|
275
278
|
info: s
|
|
276
279
|
};
|
|
277
280
|
}
|
|
278
|
-
function
|
|
279
|
-
let r =
|
|
281
|
+
function ie(e, t, n) {
|
|
282
|
+
let r = Y(e.params.clid ?? ""), i = X(e.params.reasonid ?? ""), a = r === t;
|
|
280
283
|
return r !== 0 && n.delete(r), {
|
|
281
284
|
kind: "clientLeave",
|
|
282
285
|
event: {
|
|
283
286
|
id: r,
|
|
284
287
|
reasonID: i,
|
|
285
288
|
reasonMsg: e.params.reasonmsg ?? "",
|
|
286
|
-
targetID:
|
|
289
|
+
targetID: Y(e.params.targetid ?? "")
|
|
287
290
|
},
|
|
288
291
|
isSelf: a
|
|
289
292
|
};
|
|
290
293
|
}
|
|
291
|
-
function
|
|
292
|
-
let n =
|
|
294
|
+
function ae(e, t) {
|
|
295
|
+
let n = Y(e.params.clid ?? ""), r = J(e.params.ctid ?? "");
|
|
293
296
|
if (n !== 0) {
|
|
294
297
|
let e = t.get(n);
|
|
295
298
|
e && t.set(n, {
|
|
@@ -302,67 +305,67 @@ function ie(e, t) {
|
|
|
302
305
|
event: {
|
|
303
306
|
id: n,
|
|
304
307
|
targetChannelID: r,
|
|
305
|
-
reasonID:
|
|
306
|
-
invokerID:
|
|
308
|
+
reasonID: X(e.params.reasonid ?? ""),
|
|
309
|
+
invokerID: Y(e.params.invokerid ?? ""),
|
|
307
310
|
invokerName: e.params.invokername ?? "",
|
|
308
311
|
invokerUID: e.params.invokeruid ?? ""
|
|
309
312
|
}
|
|
310
313
|
};
|
|
311
314
|
}
|
|
312
|
-
function
|
|
313
|
-
let n =
|
|
315
|
+
function oe(e, t) {
|
|
316
|
+
let n = Y(e.params.invokerid ?? ""), r = t.get(n);
|
|
314
317
|
return {
|
|
315
318
|
kind: "textMessage",
|
|
316
319
|
message: {
|
|
317
|
-
targetMode:
|
|
318
|
-
targetID:
|
|
320
|
+
targetMode: X(e.params.targetmode ?? ""),
|
|
321
|
+
targetID: J(e.params.target ?? ""),
|
|
319
322
|
invokerID: n,
|
|
320
323
|
invokerName: e.params.invokername ?? "",
|
|
321
324
|
invokerUID: e.params.invokeruid ?? r?.uid ?? "",
|
|
322
|
-
message:
|
|
325
|
+
message: S(e.params.msg ?? ""),
|
|
323
326
|
invokerGroups: r?.serverGroups ?? []
|
|
324
327
|
}
|
|
325
328
|
};
|
|
326
329
|
}
|
|
327
|
-
function
|
|
330
|
+
function se(e) {
|
|
328
331
|
return {
|
|
329
|
-
clientFileTransferID:
|
|
330
|
-
serverFileTransferID:
|
|
332
|
+
clientFileTransferID: Y(e.params.clientftfid ?? ""),
|
|
333
|
+
serverFileTransferID: Y(e.params.serverftfid ?? ""),
|
|
331
334
|
fileTransferKey: e.params.ftkey ?? "",
|
|
332
|
-
port:
|
|
333
|
-
seekPosition:
|
|
335
|
+
port: Y(e.params.port ?? ""),
|
|
336
|
+
seekPosition: J(e.params.seekpos ?? "")
|
|
334
337
|
};
|
|
335
338
|
}
|
|
336
|
-
function
|
|
339
|
+
function ce(e) {
|
|
337
340
|
return {
|
|
338
|
-
clientFileTransferID:
|
|
339
|
-
serverFileTransferID:
|
|
341
|
+
clientFileTransferID: Y(e.params.clientftfid ?? ""),
|
|
342
|
+
serverFileTransferID: Y(e.params.serverftfid ?? ""),
|
|
340
343
|
fileTransferKey: e.params.ftkey ?? "",
|
|
341
|
-
port:
|
|
342
|
-
size:
|
|
344
|
+
port: Y(e.params.port ?? ""),
|
|
345
|
+
size: J(e.params.size ?? "")
|
|
343
346
|
};
|
|
344
347
|
}
|
|
345
|
-
function
|
|
348
|
+
function le(e) {
|
|
346
349
|
return {
|
|
347
|
-
clientFileTransferID:
|
|
348
|
-
status:
|
|
350
|
+
clientFileTransferID: Y(e.params.clientftfid ?? ""),
|
|
351
|
+
status: X(e.params.status ?? ""),
|
|
349
352
|
message: e.params.msg ?? ""
|
|
350
353
|
};
|
|
351
354
|
}
|
|
352
|
-
function
|
|
355
|
+
function ue(e) {
|
|
353
356
|
return {
|
|
354
357
|
kind: "poked",
|
|
355
358
|
event: {
|
|
356
|
-
invokerID:
|
|
357
|
-
invokerName:
|
|
359
|
+
invokerID: Y(e.params.invokerid ?? ""),
|
|
360
|
+
invokerName: S(e.params.invokername ?? ""),
|
|
358
361
|
invokerUID: e.params.invokeruid ?? "",
|
|
359
|
-
message:
|
|
362
|
+
message: S(e.params.msg ?? "")
|
|
360
363
|
}
|
|
361
364
|
};
|
|
362
365
|
}
|
|
363
366
|
//#endregion
|
|
364
367
|
//#region src/throttle.ts
|
|
365
|
-
var
|
|
368
|
+
var de = class e {
|
|
366
369
|
static TOKEN_RATE = 4;
|
|
367
370
|
static TOKEN_MAX = 8;
|
|
368
371
|
#e = 5;
|
|
@@ -387,14 +390,14 @@ var ue = class e {
|
|
|
387
390
|
};
|
|
388
391
|
//#endregion
|
|
389
392
|
//#region src/client.ts
|
|
390
|
-
function
|
|
393
|
+
function fe(e) {
|
|
391
394
|
return {
|
|
392
395
|
serverPassword: e.serverPassword ?? "",
|
|
393
396
|
defaultChannel: e.defaultChannel ?? "",
|
|
394
397
|
defaultChannelPassword: e.defaultChannelPassword ?? ""
|
|
395
398
|
};
|
|
396
399
|
}
|
|
397
|
-
var
|
|
400
|
+
var pe = class {
|
|
398
401
|
crypt;
|
|
399
402
|
handler;
|
|
400
403
|
logger;
|
|
@@ -405,7 +408,7 @@ var fe = class {
|
|
|
405
408
|
#n;
|
|
406
409
|
#r;
|
|
407
410
|
#i = n.Disconnected;
|
|
408
|
-
#a = new
|
|
411
|
+
#a = new de();
|
|
409
412
|
#o = new k();
|
|
410
413
|
#s = new M();
|
|
411
414
|
#c = /* @__PURE__ */ new Map();
|
|
@@ -424,7 +427,7 @@ var fe = class {
|
|
|
424
427
|
#x;
|
|
425
428
|
#S;
|
|
426
429
|
constructor(t, n, r, i = {}) {
|
|
427
|
-
this.#e = t, this.#t = n, this.nickname = r, this.logger = i.logger ?? e, this.#n = i.resolver ?? new
|
|
430
|
+
this.#e = t, this.#t = n, this.nickname = r, this.logger = i.logger ?? e, this.#n = i.resolver ?? new y(this.logger), this.#r = fe(i), this.crypt = new v(t), this.handler = new x(this.crypt, this.logger), this.handler.onPacket = (e) => this.#T(e), this.handler.onClosed = (e) => this.#P(e), i.commandMiddleware && this.#y.push(...i.commandMiddleware), i.eventMiddleware && this.#b.push(...i.eventMiddleware), this.#x = this.#F(), this.#S = this.#I();
|
|
428
431
|
}
|
|
429
432
|
get status() {
|
|
430
433
|
return this.#i;
|
|
@@ -524,7 +527,7 @@ var fe = class {
|
|
|
524
527
|
} catch (e) {
|
|
525
528
|
throw this.#s.unregister(a), e;
|
|
526
529
|
}
|
|
527
|
-
let l = await Promise.race([s, new Promise((e, t) => setTimeout(() => t(new
|
|
530
|
+
let l = await Promise.race([s, new Promise((e, t) => setTimeout(() => t(new g()), 1e4))]);
|
|
528
531
|
if (this.#s.unregister(a), "size" in l) throw new o("unexpected download response");
|
|
529
532
|
if ("status" in l) {
|
|
530
533
|
let e = l;
|
|
@@ -539,7 +542,7 @@ var fe = class {
|
|
|
539
542
|
} catch (e) {
|
|
540
543
|
throw this.#s.unregister(r), e;
|
|
541
544
|
}
|
|
542
|
-
let s = await Promise.race([i, new Promise((e, t) => setTimeout(() => t(new
|
|
545
|
+
let s = await Promise.race([i, new Promise((e, t) => setTimeout(() => t(new g()), 1e4))]);
|
|
543
546
|
if (this.#s.unregister(r), "seekPosition" in s) throw new o("unexpected upload response");
|
|
544
547
|
if ("status" in s) {
|
|
545
548
|
let e = s;
|
|
@@ -561,7 +564,7 @@ var fe = class {
|
|
|
561
564
|
for (let t of e) setImmediate(() => t());
|
|
562
565
|
}
|
|
563
566
|
#C() {
|
|
564
|
-
this.handler.close(), this.crypt = new
|
|
567
|
+
this.handler.close(), this.crypt = new v(this.#e), this.handler = new x(this.crypt, this.logger), this.handler.onPacket = (e) => this.#T(e), this.handler.onClosed = (e) => this.#P(e), this.#o.reset(), this.#s.reset(), this.#c.clear(), this.clid = 0, this.#x = this.#F();
|
|
565
568
|
}
|
|
566
569
|
async #w() {
|
|
567
570
|
let e = this.#t.includes(":") ? this.#t : `${this.#t}:9987`;
|
|
@@ -577,8 +580,8 @@ var fe = class {
|
|
|
577
580
|
#E(e) {
|
|
578
581
|
let t = e.typeFlagged & 15;
|
|
579
582
|
if (t === 8) {
|
|
580
|
-
let t =
|
|
581
|
-
t && this.handler.sendPacket(
|
|
583
|
+
let t = te(this.crypt, e.data);
|
|
584
|
+
t && this.handler.sendPacket(b.Init1, t, 0);
|
|
582
585
|
return;
|
|
583
586
|
}
|
|
584
587
|
if ((t === 0 || t === 1) && e.data.length > 5) {
|
|
@@ -603,14 +606,14 @@ var fe = class {
|
|
|
603
606
|
let t = e.split(/[\n\0]/);
|
|
604
607
|
for (let e of t) {
|
|
605
608
|
let t = e.replace(/\r$/, "");
|
|
606
|
-
if (t) for (let e of
|
|
609
|
+
if (t) for (let e of Q(t)) this.#k(e);
|
|
607
610
|
}
|
|
608
611
|
}
|
|
609
612
|
#k(e) {
|
|
610
613
|
let t = E(e);
|
|
611
614
|
if (!(!t || !t.name)) {
|
|
612
615
|
if (t.name.startsWith("notify")) {
|
|
613
|
-
let e =
|
|
616
|
+
let e = ne(t, this.clid, this.#c, this.nickname);
|
|
614
617
|
this.#j(e, t.params);
|
|
615
618
|
return;
|
|
616
619
|
}
|
|
@@ -650,7 +653,7 @@ var fe = class {
|
|
|
650
653
|
switch (e.kind) {
|
|
651
654
|
case "clientEnter": {
|
|
652
655
|
let t = e.info;
|
|
653
|
-
t.id !== 0 &&
|
|
656
|
+
t.id !== 0 && Z(this.nickname, t.nickname) && (this.clid = t.id, this.handler.setClientID(t.id), this.#o.signalWelcomeComplete()), this.#M("clientEnter", t);
|
|
654
657
|
break;
|
|
655
658
|
}
|
|
656
659
|
case "clientLeave":
|
|
@@ -709,7 +712,7 @@ var fe = class {
|
|
|
709
712
|
}
|
|
710
713
|
#F() {
|
|
711
714
|
return R(this.#y, async (e) => {
|
|
712
|
-
this.handler.sendPacket(
|
|
715
|
+
this.handler.sendPacket(b.Command, Buffer.from(e), 0);
|
|
713
716
|
});
|
|
714
717
|
}
|
|
715
718
|
#I() {
|
|
@@ -720,43 +723,43 @@ var fe = class {
|
|
|
720
723
|
};
|
|
721
724
|
//#endregion
|
|
722
725
|
//#region src/api.ts
|
|
723
|
-
async function
|
|
724
|
-
let i =
|
|
726
|
+
async function $(e, t, n, r) {
|
|
727
|
+
let i = C("sendtextmessage", [
|
|
725
728
|
["targetmode", String(t)],
|
|
726
729
|
["target", String(n)],
|
|
727
730
|
["msg", r]
|
|
728
731
|
]);
|
|
729
732
|
await e.sendCommandNoWait(i);
|
|
730
733
|
}
|
|
731
|
-
async function
|
|
734
|
+
async function me(e, t, n, r = "") {
|
|
732
735
|
let i = [["clid", String(t)], ["cid", String(n)]];
|
|
733
736
|
r && i.push(["cpw", r]);
|
|
734
|
-
let a =
|
|
737
|
+
let a = C("clientmove", i);
|
|
735
738
|
await e.execCommand(a, 1e4);
|
|
736
739
|
}
|
|
737
|
-
async function
|
|
738
|
-
let r =
|
|
740
|
+
async function he(e, t, n) {
|
|
741
|
+
let r = C("clientpoke", [["clid", String(t)], ["msg", n]]);
|
|
739
742
|
await e.execCommand(r, 1e4);
|
|
740
743
|
}
|
|
741
|
-
async function
|
|
744
|
+
async function ge(e, t) {
|
|
742
745
|
let n = (await e.execCommandWithResponse(`clientinfo clid=${t}`, 5e3))[0];
|
|
743
746
|
if (!n) throw Error(`no data returned for client ${t}`);
|
|
744
747
|
return n;
|
|
745
748
|
}
|
|
746
|
-
async function
|
|
749
|
+
async function _e(e) {
|
|
747
750
|
return (await e.execCommandWithResponse("channellist", 5e3)).map((e) => ({
|
|
748
751
|
id: BigInt(e.cid ?? "0"),
|
|
749
752
|
parentID: BigInt(e.pid ?? "0"),
|
|
750
|
-
name:
|
|
753
|
+
name: S(e.channel_name ?? ""),
|
|
751
754
|
description: ""
|
|
752
755
|
}));
|
|
753
756
|
}
|
|
754
|
-
async function
|
|
757
|
+
async function ve(e) {
|
|
755
758
|
return (await e.execCommandWithResponse("clientlist -uid -away -voice -groups", 5e3)).map((e) => {
|
|
756
759
|
let t = e.client_servergroups ?? "";
|
|
757
760
|
return {
|
|
758
761
|
id: parseInt(e.clid ?? "0", 10),
|
|
759
|
-
nickname:
|
|
762
|
+
nickname: S(e.client_nickname ?? ""),
|
|
760
763
|
uid: e.client_unique_identifier ?? "",
|
|
761
764
|
channelID: BigInt(e.cid ?? "0"),
|
|
762
765
|
type: parseInt(e.client_type ?? "0", 10),
|
|
@@ -764,9 +767,9 @@ async function _e(e) {
|
|
|
764
767
|
};
|
|
765
768
|
});
|
|
766
769
|
}
|
|
767
|
-
async function
|
|
770
|
+
async function ye(e, t, n) {
|
|
768
771
|
if (n.length === 0) return;
|
|
769
|
-
let r = n.join("|"), i =
|
|
772
|
+
let r = n.join("|"), i = w("ftdeletefile", {
|
|
770
773
|
cid: String(t),
|
|
771
774
|
cpw: "",
|
|
772
775
|
name: r
|
|
@@ -774,6 +777,6 @@ async function ve(e, t, n) {
|
|
|
774
777
|
await e.execCommand(i, 1e4);
|
|
775
778
|
}
|
|
776
779
|
//#endregion
|
|
777
|
-
export { l as AlreadyConnectedError,
|
|
780
|
+
export { l as AlreadyConnectedError, pe as Client, n as ClientStatus, c as CommandTimeoutError, a as CryptoInitError, m as EAXTagMismatchError, _ as FakeSignatureMismatchError, o as FileTransferError, g as FileTransferTimeoutError, u as Identity, i as InvalidIdentityError, r as ServerError, h as TeamspeakError, me as clientMove, e as consoleLogger, N as dialFileTransfer, F as downloadFileData, ye as fileTransferDeleteFile, p as generateIdentity, ge as getClientInfo, s as getUidFromPublicKey, ee as identityFromString, _e as listChannels, ve as listClients, t as noopLogger, he as poke, $ as sendTextMessage, P as uploadFileData };
|
|
778
781
|
|
|
779
782
|
//# sourceMappingURL=index.mjs.map
|