oceanic.js 1.0.0-dev.7b63f49 → 1.0.0-dev.9c8a5db
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 +2 -2
- package/dist/lib/Client.js +7 -7
- package/dist/lib/Constants.d.ts +1 -1
- package/dist/lib/Constants.js +1 -1
- package/dist/lib/gateway/Shard.js +58 -58
- package/dist/lib/gateway/ShardManager.js +3 -3
- package/dist/lib/rest/Bucket.js +2 -2
- package/dist/lib/rest/DiscordHTTPError.js +1 -1
- package/dist/lib/rest/DiscordRESTError.js +1 -1
- package/dist/lib/rest/RequestHandler.js +8 -8
- package/dist/lib/rest/SequentialBucket.js +1 -1
- package/dist/lib/routes/Guilds.js +1 -1
- package/dist/lib/routes/OAuth.js +3 -3
- package/dist/lib/structures/Application.js +3 -3
- package/dist/lib/structures/ApplicationCommand.js +3 -3
- package/dist/lib/structures/AutocompleteInteraction.js +4 -4
- package/dist/lib/structures/CommandInteraction.js +4 -4
- package/dist/lib/structures/ComponentInteraction.js +3 -3
- package/dist/lib/structures/Guild.js +6 -6
- package/dist/lib/structures/GuildChannel.js +3 -2
- package/dist/lib/structures/GuildScheduledEvent.js +1 -1
- package/dist/lib/structures/Invite.js +4 -4
- package/dist/lib/structures/Member.js +5 -5
- package/dist/lib/structures/Message.d.ts +5 -4
- package/dist/lib/structures/Message.js +23 -16
- package/dist/lib/structures/ModalSubmitInteraction.js +3 -3
- package/dist/lib/structures/Role.js +3 -3
- package/dist/lib/structures/StageInstance.js +1 -1
- package/dist/lib/structures/VoiceState.js +1 -1
- package/dist/lib/structures/Webhook.js +11 -11
- package/dist/lib/types/events.d.ts +2 -2
- package/dist/lib/types/guilds.d.ts +3 -0
- package/dist/lib/util/InteractionOptionsWrapper.js +1 -1
- package/dist/lib/util/Routes.js +1 -1
- package/dist/lib/util/TypedCollection.js +3 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ A NodeJS Library for Discord.
|
|
|
6
6
|
## Installation
|
|
7
7
|
NodeJS **16.16.0** or higher is required.
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**See [Development Builds](#development-builds) if you wish to install in-dev versions.**
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
npm i oceanic.js
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
See the `examples` folder on GitHub for some examples, and visit [this site](https://oceanic.owo-whats-this.dev) for documentation.
|
|
16
16
|
|
|
17
17
|
### Development Builds
|
|
18
18
|
```sh
|
package/dist/lib/Client.js
CHANGED
|
@@ -50,13 +50,13 @@ class Client extends TypedEmitter_1.default {
|
|
|
50
50
|
constructor(options) {
|
|
51
51
|
super();
|
|
52
52
|
this.options = {
|
|
53
|
-
allowedMentions: options?.allowedMentions
|
|
53
|
+
allowedMentions: options?.allowedMentions ?? {
|
|
54
54
|
everyone: false,
|
|
55
55
|
repliedUser: false,
|
|
56
56
|
users: true,
|
|
57
57
|
roles: true
|
|
58
58
|
},
|
|
59
|
-
auth: options?.auth
|
|
59
|
+
auth: options?.auth ?? null,
|
|
60
60
|
collectionLimits: {
|
|
61
61
|
members: options?.collectionLimits?.members === undefined ? Infinity : typeof options.collectionLimits.members === "object" ? {
|
|
62
62
|
unknown: Infinity,
|
|
@@ -65,8 +65,8 @@ class Client extends TypedEmitter_1.default {
|
|
|
65
65
|
messages: options?.collectionLimits?.messages ?? 100,
|
|
66
66
|
users: options?.collectionLimits?.users ?? Infinity
|
|
67
67
|
},
|
|
68
|
-
defaultImageFormat: options?.defaultImageFormat
|
|
69
|
-
defaultImageSize: options?.defaultImageSize
|
|
68
|
+
defaultImageFormat: options?.defaultImageFormat ?? "png",
|
|
69
|
+
defaultImageSize: options?.defaultImageSize ?? 4096
|
|
70
70
|
};
|
|
71
71
|
this.channelGuildMap = {};
|
|
72
72
|
this.groupChannels = new TypedCollection_1.default(GroupChannel_1.default, this, 10);
|
|
@@ -172,7 +172,7 @@ class Client extends TypedEmitter_1.default {
|
|
|
172
172
|
if (this.channelGuildMap[id]) {
|
|
173
173
|
return this.guilds.get(this.channelGuildMap[id])?.channels.get(id);
|
|
174
174
|
}
|
|
175
|
-
return (this.privateChannels.get(id)
|
|
175
|
+
return (this.privateChannels.get(id) ?? this.groupChannels.get(id));
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* Join a voice channel.
|
|
@@ -187,7 +187,7 @@ class Client extends TypedEmitter_1.default {
|
|
|
187
187
|
if (channel.type !== Constants_1.ChannelTypes.GUILD_VOICE && channel.type !== Constants_1.ChannelTypes.GUILD_STAGE_VOICE) {
|
|
188
188
|
throw new Error("Only voice & stage channels can be joined.");
|
|
189
189
|
}
|
|
190
|
-
this.shards.get(this.guildShardMap[channel.guildID]
|
|
190
|
+
this.shards.get(this.guildShardMap[channel.guildID] ?? 0).updateVoiceState(channel.guildID, channelID, options);
|
|
191
191
|
// @TODO proper voice connection handling
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
@@ -199,7 +199,7 @@ class Client extends TypedEmitter_1.default {
|
|
|
199
199
|
if (!channel || (channel.type !== Constants_1.ChannelTypes.GUILD_VOICE && channel.type !== Constants_1.ChannelTypes.GUILD_STAGE_VOICE)) {
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
this.shards.get(this.guildShardMap[channel.guildID]
|
|
202
|
+
this.shards.get(this.guildShardMap[channel.guildID] ?? 0).updateVoiceState(channel.guildID, null, { selfDeaf: false, selfMute: false });
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
exports.default = Client;
|
package/dist/lib/Constants.d.ts
CHANGED
package/dist/lib/Constants.js
CHANGED
|
@@ -739,7 +739,7 @@ var ActivityTypes;
|
|
|
739
739
|
var ActivityFlags;
|
|
740
740
|
(function (ActivityFlags) {
|
|
741
741
|
ActivityFlags[ActivityFlags["INSTANCE"] = 1] = "INSTANCE";
|
|
742
|
-
ActivityFlags[ActivityFlags["
|
|
742
|
+
ActivityFlags[ActivityFlags["JOIN"] = 2] = "JOIN";
|
|
743
743
|
ActivityFlags[ActivityFlags["SPECTATE"] = 4] = "SPECTATE";
|
|
744
744
|
ActivityFlags[ActivityFlags["JOIN_REQUEST"] = 8] = "JOIN_REQUEST";
|
|
745
745
|
ActivityFlags[ActivityFlags["SYNC"] = 16] = "SYNC";
|