kol.js 0.1.0 → 0.1.2
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/package.json +2 -1
- package/src/Client.ts +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kol.js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"async-mutex": "^0.5.0",
|
|
24
24
|
"date-fns": "^3.6.0",
|
|
25
25
|
"got": "^14.3.0",
|
|
26
|
+
"html-entities": "^2.5.2",
|
|
26
27
|
"node-html-parser": "^6.1.13",
|
|
27
28
|
"querystring": "^0.2.1",
|
|
28
29
|
"tough-cookie": "^4.1.4",
|
package/src/Client.ts
CHANGED
|
@@ -49,9 +49,15 @@ export class Client extends (EventEmitter as new () => TypedEmitter<Events>) {
|
|
|
49
49
|
prefixUrl: "https://www.kingdomofloathing.com",
|
|
50
50
|
handlers: [
|
|
51
51
|
(options, next) => {
|
|
52
|
-
if (options.form
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
if (options.form) {
|
|
53
|
+
if (options.form.pwd !== false) options.form.pwd = this.#pwd;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (options.searchParams) {
|
|
57
|
+
const searchParams = options.searchParams as URLSearchParams;
|
|
58
|
+
if (searchParams.get("pwd") !== "false") searchParams.set("pwd", this.#pwd);
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
return next(options);
|
|
56
62
|
},
|
|
57
63
|
],
|
|
@@ -429,6 +435,7 @@ export class Client extends (EventEmitter as new () => TypedEmitter<Events>) {
|
|
|
429
435
|
whichclan: id,
|
|
430
436
|
action: "joinclan",
|
|
431
437
|
confirm: "on",
|
|
438
|
+
pwd: true,
|
|
432
439
|
},
|
|
433
440
|
});
|
|
434
441
|
return (
|