magmastream 2.9.3-dev.2 → 2.9.3-dev.20
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/dist/index.d.ts +168 -101
- package/dist/index.js +1 -1
- package/dist/statestorage/JsonQueue.js +28 -4
- package/dist/statestorage/MemoryQueue.js +51 -36
- package/dist/statestorage/RedisQueue.js +30 -9
- package/dist/structures/Enums.js +6 -0
- package/dist/structures/Filters.js +5 -4
- package/dist/structures/Manager.js +62 -48
- package/dist/structures/Node.js +91 -145
- package/dist/structures/Player.js +31 -124
- package/dist/structures/Rest.js +41 -21
- package/dist/structures/Utils.js +139 -77
- package/dist/wrappers/discord.js.js +13 -4
- package/dist/wrappers/discordeno.js +73 -0
- package/dist/wrappers/eris.js +14 -3
- package/dist/wrappers/oceanic.js +16 -4
- package/dist/wrappers/seyfert.js +19 -1
- package/package.json +30 -23
- package/dist/wrappers/detritus.js +0 -52
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DetritusManager = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const Manager_1 = require("../structures/Manager");
|
|
6
|
-
const detritus_client_1 = require("detritus-client");
|
|
7
|
-
tslib_1.__exportStar(require("../index"), exports);
|
|
8
|
-
/**
|
|
9
|
-
* Detritus wrapper for Magmastream.
|
|
10
|
-
*/
|
|
11
|
-
class DetritusManager extends Manager_1.Manager {
|
|
12
|
-
client;
|
|
13
|
-
constructor(client, options) {
|
|
14
|
-
super(options);
|
|
15
|
-
this.client = client;
|
|
16
|
-
client.once("ready", () => {
|
|
17
|
-
if (!this.options.clientId)
|
|
18
|
-
this.options.clientId = client instanceof detritus_client_1.ClusterClient ? client.applicationId : client.clientId;
|
|
19
|
-
});
|
|
20
|
-
client.on("raw", async (packet) => {
|
|
21
|
-
await this.updateVoiceState(packet);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
send(packet) {
|
|
25
|
-
const asCluster = this.client;
|
|
26
|
-
const asShard = this.client;
|
|
27
|
-
if (asShard.guilds)
|
|
28
|
-
return asShard.gateway.send(packet.op, packet.d);
|
|
29
|
-
if (asCluster.shards) {
|
|
30
|
-
const shard = asCluster.shards.find((c) => c.guilds.has(packet.d.guild_id));
|
|
31
|
-
if (shard)
|
|
32
|
-
shard.gateway.send(packet.op, packet.d);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async resolveUser(user) {
|
|
36
|
-
const id = typeof user === "string" ? user : user.id;
|
|
37
|
-
if (this.client instanceof detritus_client_1.ShardClient) {
|
|
38
|
-
const cached = this.client.users.get(id);
|
|
39
|
-
if (cached)
|
|
40
|
-
return { id: cached.id, username: cached.username };
|
|
41
|
-
}
|
|
42
|
-
else if (this.client instanceof detritus_client_1.ClusterClient) {
|
|
43
|
-
for (const [, shard] of this.client.shards) {
|
|
44
|
-
const cached = shard.users.get(id);
|
|
45
|
-
if (cached)
|
|
46
|
-
return { id: cached.id, username: cached.username };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return typeof user === "string" ? { id: user } : user;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.DetritusManager = DetritusManager;
|