magmastream 2.9.1-dev.0 → 2.9.1-dev.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/README.md CHANGED
@@ -120,6 +120,7 @@ Want to showcase your bot? Feel free to create a pull request and add it to our
120
120
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/Vexify4103"><img src="https://avatars.githubusercontent.com/u/47192617?v=4?s=100" width="100px;" alt="Vexify4103"/><br /><sub><b>Vexify4103</b></sub></a><br /><a href="#code-Vexify4103" title="Code">💻</a> <a href="#doc-Vexify4103" title="Documentation">📖</a></td>
121
121
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/ItzRandom23"><img src="https://avatars.githubusercontent.com/u/100831398?v=4?s=100" width="100px;" alt="Itz Random"/><br /><sub><b>Itz Random</b></sub></a><br /><a href="#code-ItzRandom23" title="Code">💻</a></td>
122
122
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/Yanishamburger"><img src="https://avatars.githubusercontent.com/u/121449519?v=4?s=100" width="100px;" alt="Yanis_Hamburger"/><br /><sub><b>Yanis_Hamburger</b></sub></a><br /><a href="#bug-Yanishamburger" title="Bug reports">🐛</a></td>
123
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/Kenver123"><img src="https://avatars.githubusercontent.com/u/165576302?v=4?s=100" width="100px;" alt="Kenver"/><br /><sub><b>Kenver</b></sub></a><br /><a href="#platform-Kenver123" title="Packaging/porting to new platform">📦</a></td>
123
124
  </tr>
124
125
  </tbody>
125
126
  </table>
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { Redis } from 'ioredis';
7
7
  import { Client as Client$1 } from 'eris';
8
8
  import { ClusterClient, ShardClient } from 'detritus-client';
9
9
  import { Client as Client$2 } from 'oceanic.js';
10
- import { Client as Client$3 } from 'seyfert';
10
+ import { Client as Client$3, WorkerClient } from 'seyfert';
11
11
 
12
12
  /** Represents an equalizer band. */
13
13
  interface Band {
@@ -74,6 +74,7 @@ declare enum LoadTypes {
74
74
  */
75
75
  declare enum SearchPlatform {
76
76
  AppleMusic = "amsearch",
77
+ Audius = "audsearch",
77
78
  Bandcamp = "bcsearch",
78
79
  Deezer = "dzsearch",
79
80
  Jiosaavn = "jssearch",
@@ -106,6 +107,7 @@ declare enum PlayerStateEventTypes {
106
107
  */
107
108
  declare enum TrackSourceTypes {
108
109
  AppleMusic = "applemusic",
110
+ Audius = "audius",
109
111
  Bandcamp = "bandcamp",
110
112
  Deezer = "deezer",
111
113
  Jiosaavn = "jiosaavn",
@@ -3548,8 +3550,8 @@ declare class OceanicManager extends Manager {
3548
3550
  * ```
3549
3551
  */
3550
3552
  declare class SeyfertManager extends Manager {
3551
- readonly client: Client$3;
3552
- constructor(client: Client$3, options?: ManagerOptions);
3553
+ readonly client: Client$3 | WorkerClient;
3554
+ constructor(client: Client$3 | WorkerClient, options?: ManagerOptions);
3553
3555
  protected send(packet: GatewayVoiceStateUpdate): void;
3554
3556
  }
3555
3557
 
@@ -63,6 +63,7 @@ var LoadTypes;
63
63
  var SearchPlatform;
64
64
  (function (SearchPlatform) {
65
65
  SearchPlatform["AppleMusic"] = "amsearch";
66
+ SearchPlatform["Audius"] = "audsearch";
66
67
  SearchPlatform["Bandcamp"] = "bcsearch";
67
68
  SearchPlatform["Deezer"] = "dzsearch";
68
69
  SearchPlatform["Jiosaavn"] = "jssearch";
@@ -97,6 +98,7 @@ var PlayerStateEventTypes;
97
98
  var TrackSourceTypes;
98
99
  (function (TrackSourceTypes) {
99
100
  TrackSourceTypes["AppleMusic"] = "applemusic";
101
+ TrackSourceTypes["Audius"] = "audius";
100
102
  TrackSourceTypes["Bandcamp"] = "bandcamp";
101
103
  TrackSourceTypes["Deezer"] = "deezer";
102
104
  TrackSourceTypes["Jiosaavn"] = "jiosaavn";
@@ -378,7 +378,7 @@ class Node {
378
378
  this.socket?.removeAllListeners();
379
379
  this.socket = null;
380
380
  this.manager.emit(Enums_1.ManagerEventTypes.NodeReconnect, this);
381
- this.connect();
381
+ await this.connect();
382
382
  this.reconnectAttempts++;
383
383
  }, this.options.retryDelayMs);
384
384
  }
@@ -117,7 +117,7 @@ class Rest {
117
117
  }
118
118
  else if (error.response.status === 404) {
119
119
  await this.node.destroy();
120
- this.node.manager.createNode(this.node.options).connect();
120
+ await this.node.manager.createNode(this.node.options).connect();
121
121
  }
122
122
  return null;
123
123
  }
@@ -87,6 +87,7 @@ class TrackUtils {
87
87
  try {
88
88
  const sourceNameMap = {
89
89
  applemusic: "AppleMusic",
90
+ audius: "Audius",
90
91
  bandcamp: "Bandcamp",
91
92
  deezer: "Deezer",
92
93
  jiosaavn: "Jiosaavn",
@@ -95,6 +96,7 @@ class TrackUtils {
95
96
  tidal: "Tidal",
96
97
  youtube: "YouTube",
97
98
  vkmusic: "VKMusic",
99
+ qobuz: "Qobuz",
98
100
  };
99
101
  const track = {
100
102
  track: data.encoded,
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DiscordJSManager = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Manager_1 = require("../structures/Manager");
6
+ const discord_js_1 = require("discord.js");
7
+ const [major, minor] = discord_js_1.version.split(".").map(Number);
6
8
  tslib_1.__exportStar(require("../index"), exports);
7
9
  /**
8
10
  * Discord.js wrapper for Magmastream.
@@ -12,10 +14,21 @@ class DiscordJSManager extends Manager_1.Manager {
12
14
  constructor(client, options) {
13
15
  super(options);
14
16
  this.client = client;
15
- client.once("clientReady", () => {
16
- if (!this.options.clientId)
17
- this.options.clientId = client.user.id;
18
- });
17
+ const attachReadyHandler = () => {
18
+ const handler = () => {
19
+ if (!this.options.clientId)
20
+ this.options.clientId = this.client.user.id;
21
+ };
22
+ // Only attach clientReady if Discord.js >= 14.22.0
23
+ if (major > 14 || (major === 14 && minor >= 22)) {
24
+ client.once("clientReady", handler);
25
+ }
26
+ // Only attach ready if Discord.js < 14.22.0
27
+ if (major < 14 || (major === 14 && minor < 22)) {
28
+ client.once("ready", handler);
29
+ }
30
+ };
31
+ attachReadyHandler();
19
32
  client.on("raw", async (data) => {
20
33
  await this.updateVoiceState(data);
21
34
  });
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SeyfertManager = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Manager_1 = require("../structures/Manager");
6
+ const seyfert_1 = require("seyfert");
6
7
  const common_1 = require("seyfert/lib/common");
7
8
  tslib_1.__exportStar(require("../index"), exports);
8
9
  /**
@@ -37,7 +38,12 @@ class SeyfertManager extends Manager_1.Manager {
37
38
  this.client = client;
38
39
  }
39
40
  send(packet) {
40
- this.client.gateway.send((0, common_1.calculateShardId)(packet.d.guild_id), packet);
41
+ if (this.client instanceof seyfert_1.WorkerClient) {
42
+ this.client.shards.get((0, common_1.calculateShardId)(packet.d.guild_id))?.send(true, packet);
43
+ }
44
+ else {
45
+ this.client.gateway.send((0, common_1.calculateShardId)(packet.d.guild_id), packet);
46
+ }
41
47
  }
42
48
  }
43
49
  exports.SeyfertManager = SeyfertManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.9.1-dev.0",
3
+ "version": "2.9.1-dev.2",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",