disgroove 3.0.0-dev.72bf12 → 3.0.0-dev.97f3796
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/lib/Client.d.ts +1 -1
- package/dist/lib/Client.js +3 -3
- package/dist/lib/gateway/Shard.js +2 -2
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +1 -0
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +1 -1
- package/package.json +2 -2
- package/d +0 -2268
package/dist/lib/Client.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare class Client extends EventEmitter {
|
|
|
55
55
|
auth: "Bot" | "Bearer";
|
|
56
56
|
shards: Map<number, Shard>;
|
|
57
57
|
rest: RequestManager;
|
|
58
|
-
guildShardMap:
|
|
58
|
+
guildShardMap: Map<string, number>;
|
|
59
59
|
user: User | null;
|
|
60
60
|
guilds: Map<string, Guild>;
|
|
61
61
|
application: Pick<Application, "id" | "flags"> | null;
|
package/dist/lib/Client.js
CHANGED
|
@@ -42,7 +42,7 @@ class Client extends node_events_1.default {
|
|
|
42
42
|
this.auth = options?.auth ?? "Bot";
|
|
43
43
|
this.shards = new Map();
|
|
44
44
|
this.rest = new rest_1.RequestManager(token, this.auth);
|
|
45
|
-
this.guildShardMap =
|
|
45
|
+
this.guildShardMap = new Map();
|
|
46
46
|
this.user = null;
|
|
47
47
|
this.guilds = new Map();
|
|
48
48
|
this.application = null;
|
|
@@ -2361,7 +2361,7 @@ class Client extends node_events_1.default {
|
|
|
2361
2361
|
}
|
|
2362
2362
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
2363
2363
|
joinVoiceChannel(guildId, channelId, options) {
|
|
2364
|
-
this.shards.get(this.guildShardMap
|
|
2364
|
+
this.shards.get(this.guildShardMap.get(guildId)).updateVoiceState({
|
|
2365
2365
|
guildId,
|
|
2366
2366
|
channelId,
|
|
2367
2367
|
selfMute: !!options?.selfMute,
|
|
@@ -2382,7 +2382,7 @@ class Client extends node_events_1.default {
|
|
|
2382
2382
|
}
|
|
2383
2383
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
2384
2384
|
leaveVoiceChannel(guildId) {
|
|
2385
|
-
this.shards.get(this.guildShardMap
|
|
2385
|
+
this.shards.get(this.guildShardMap.get(guildId)).updateVoiceState({
|
|
2386
2386
|
guildId,
|
|
2387
2387
|
channelId: null,
|
|
2388
2388
|
selfMute: false,
|
|
@@ -241,7 +241,7 @@ class Shard {
|
|
|
241
241
|
break;
|
|
242
242
|
case constants_1.GatewayEvents.GuildCreate:
|
|
243
243
|
{
|
|
244
|
-
this.client.guildShardMap
|
|
244
|
+
this.client.guildShardMap.set(packet.d.id, this.id);
|
|
245
245
|
this.client.guilds.set(packet.d.id, transformers_1.Guilds.guildFromRaw(packet.d));
|
|
246
246
|
this.client.emit("guildCreate", transformers_1.Guilds.guildFromRaw(packet.d));
|
|
247
247
|
}
|
|
@@ -254,7 +254,7 @@ class Shard {
|
|
|
254
254
|
break;
|
|
255
255
|
case constants_1.GatewayEvents.GuildDelete:
|
|
256
256
|
{
|
|
257
|
-
|
|
257
|
+
this.client.guildShardMap.delete(packet.d.id);
|
|
258
258
|
this.client.guilds.delete(packet.d.id);
|
|
259
259
|
this.client.emit("guildDelete", {
|
|
260
260
|
id: packet.d.id,
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasPermission = hasPermission;
|
|
4
|
+
/** https://discord.com/developers/docs/topics/permissions */
|
|
5
|
+
function hasPermission(userPermissions, permission) {
|
|
6
|
+
return (BigInt(userPermissions) & permission) === permission;
|
|
7
|
+
}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disgroove",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.97f3796",
|
|
4
4
|
"description": "A module to interface with Discord",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ws": "^8.18.3"
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|