kol.js 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. 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.0",
3
+ "version": "0.1.1",
4
4
  "main": "src/index.ts",
5
5
  "type": "module",
6
6
  "files": [
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?.pwd === true) options.form.pwd = this.#pwd;
53
- const searchParams = options.searchParams as URLSearchParams;
54
- if (searchParams.has("pwd")) searchParams.set("pwd", this.#pwd);
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 (