magmastream 2.10.2-alpha.3 → 2.10.2-alpha.4

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.
@@ -15,6 +15,7 @@ const ioredis_1 = tslib_1.__importDefault(require("ioredis"));
15
15
  const Enums_1 = require("./Enums");
16
16
  const package_json_1 = require("../../package.json");
17
17
  const MagmastreamError_1 = require("./MagmastreamError");
18
+ const lodash_1 = tslib_1.__importDefault(require("lodash"));
18
19
  /**
19
20
  * The main hub for interacting with Lavalink and using Magmastream.
20
21
  */
@@ -178,13 +179,7 @@ class Manager extends events_1.EventEmitter {
178
179
  this.options.clusterId = clusterId;
179
180
  }
180
181
  if (this.options.stateStorage.type === Enums_1.StateStorageType.Redis) {
181
- const config = this.options.stateStorage.redisConfig;
182
- this.redis = new ioredis_1.default({
183
- host: config.host,
184
- port: Number(config.port),
185
- password: config.password,
186
- db: config.db ?? 0,
187
- });
182
+ this.redis = new ioredis_1.default(lodash_1.default.omit(this.options.stateStorage.redisConfig, "prefix"));
188
183
  }
189
184
  const results = await Promise.allSettled([...this.nodes.values()].map(async (node) => {
190
185
  await node.connect();
@@ -107,6 +107,7 @@ class Rest {
107
107
  code: Enums_1.MagmaStreamErrorCode.REST_REQUEST_FAILED,
108
108
  message: `${isTimeout ? "Timeout" : "Network error"} on ${method} ${endpoint}: ${message}`,
109
109
  });
110
+ // Emit so the node manager can react (e.g. trigger reconnection logic)
110
111
  this.manager.emit(Enums_1.ManagerEventTypes.NodeError, this.node, error);
111
112
  return null;
112
113
  }
@@ -10,6 +10,7 @@ import { AutoPlayPlatform, LoadTypes, ManagerEventTypes, PlayerStateEventTypes,
10
10
  import { Node } from "./Node";
11
11
  import { Player } from "./Player";
12
12
  import { Plugin } from "./Plugin";
13
+ import { RedisOptions } from "ioredis";
13
14
  /**
14
15
  * Manager Options
15
16
  */
@@ -242,11 +243,7 @@ export interface VoiceServerUpdate {
242
243
  /**
243
244
  * Redis Configuration
244
245
  */
245
- export interface RedisConfig {
246
- host: string;
247
- port: number;
248
- password?: string;
249
- db?: number;
246
+ export interface RedisConfig extends RedisOptions {
250
247
  prefix?: string;
251
248
  }
252
249
  /**
@@ -788,9 +788,7 @@ class PlayerUtils {
788
788
  * Gets the Redis key for player storage.
789
789
  */
790
790
  static getRedisKey() {
791
- const cfg = this.manager.options.stateStorage.redisConfig;
792
- // Default prefix
793
- let prefix = (cfg.prefix ?? "magmastream:").trim();
791
+ let prefix = (this.manager.options.stateStorage.redisConfig.prefix ?? "magmastream:").trim();
794
792
  prefix = prefix.replace(/:+$/g, "") + ":";
795
793
  return prefix;
796
794
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.10.2-alpha.3",
3
+ "version": "2.10.2-alpha.4",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,11 +23,11 @@
23
23
  "@favware/rollup-type-bundler": "^4.0.0",
24
24
  "@types/jsdom": "^28.0.0",
25
25
  "@types/lodash": "^4.17.24",
26
- "@types/node": "^25.3.0",
26
+ "@types/node": "^25.3.5",
27
27
  "@types/ws": "^8.18.1",
28
- "@typescript-eslint/eslint-plugin": "^8.56.0",
29
- "@typescript-eslint/parser": "^8.56.0",
30
- "eslint": "^10.0.2",
28
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
29
+ "@typescript-eslint/parser": "^8.56.1",
30
+ "eslint": "^10.0.3",
31
31
  "npm-run-all": "^4.1.5",
32
32
  "prettier": "^3.8.1",
33
33
  "typedoc": "^0.28.17",
@@ -50,7 +50,7 @@
50
50
  "discord.js": "14.x",
51
51
  "discordeno": "21.x",
52
52
  "eris": "0.18.x",
53
- "oceanic.js": "1.13.x",
53
+ "oceanic.js": "1.14.x",
54
54
  "seyfert": "4.x"
55
55
  },
56
56
  "overrides": {