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.
Files changed (37) hide show
  1. package/README.md +2 -2
  2. package/dist/lib/Client.js +7 -7
  3. package/dist/lib/Constants.d.ts +1 -1
  4. package/dist/lib/Constants.js +1 -1
  5. package/dist/lib/gateway/Shard.js +58 -58
  6. package/dist/lib/gateway/ShardManager.js +3 -3
  7. package/dist/lib/rest/Bucket.js +2 -2
  8. package/dist/lib/rest/DiscordHTTPError.js +1 -1
  9. package/dist/lib/rest/DiscordRESTError.js +1 -1
  10. package/dist/lib/rest/RequestHandler.js +8 -8
  11. package/dist/lib/rest/SequentialBucket.js +1 -1
  12. package/dist/lib/routes/Guilds.js +1 -1
  13. package/dist/lib/routes/OAuth.js +3 -3
  14. package/dist/lib/structures/Application.js +3 -3
  15. package/dist/lib/structures/ApplicationCommand.js +3 -3
  16. package/dist/lib/structures/AutocompleteInteraction.js +4 -4
  17. package/dist/lib/structures/CommandInteraction.js +4 -4
  18. package/dist/lib/structures/ComponentInteraction.js +3 -3
  19. package/dist/lib/structures/Guild.js +6 -6
  20. package/dist/lib/structures/GuildChannel.js +3 -2
  21. package/dist/lib/structures/GuildScheduledEvent.js +1 -1
  22. package/dist/lib/structures/Invite.js +4 -4
  23. package/dist/lib/structures/Member.js +5 -5
  24. package/dist/lib/structures/Message.d.ts +5 -4
  25. package/dist/lib/structures/Message.js +23 -16
  26. package/dist/lib/structures/ModalSubmitInteraction.js +3 -3
  27. package/dist/lib/structures/Role.js +3 -3
  28. package/dist/lib/structures/StageInstance.js +1 -1
  29. package/dist/lib/structures/VoiceState.js +1 -1
  30. package/dist/lib/structures/Webhook.js +11 -11
  31. package/dist/lib/types/events.d.ts +2 -2
  32. package/dist/lib/types/guilds.d.ts +3 -0
  33. package/dist/lib/util/InteractionOptionsWrapper.js +1 -1
  34. package/dist/lib/util/Routes.js +1 -1
  35. package/dist/lib/util/TypedCollection.js +3 -3
  36. package/dist/package.json +1 -1
  37. 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
- **Do note we are currently in the alpha stage. Releases will be made when I see fit. See [Development Builds](#development-builds) if you wish to install in-dev versions. (due to the nature of an alpha, bugs are being found all the time, so installing in-dev versions is currently your best bet for being up-to-date)**
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
- This module is in its early alpha stages. See the `examples` folder on GitHub for some examples, and visit [this site](https://oceanic.owo-whats-this.dev) for documentation.
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
@@ -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 || null,
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 || "png",
69
- defaultImageSize: options?.defaultImageSize || 4096
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) || this.groupChannels.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] || 0).updateVoiceState(channel.guildID, channelID, options);
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] || 0).updateVoiceState(channel.guildID, null, { selfDeaf: false, selfMute: false });
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;
@@ -556,7 +556,7 @@ export declare enum ActivityTypes {
556
556
  }
557
557
  export declare enum ActivityFlags {
558
558
  INSTANCE = 1,
559
- JOIn = 2,
559
+ JOIN = 2,
560
560
  SPECTATE = 4,
561
561
  JOIN_REQUEST = 8,
562
562
  SYNC = 16,
@@ -739,7 +739,7 @@ var ActivityTypes;
739
739
  var ActivityFlags;
740
740
  (function (ActivityFlags) {
741
741
  ActivityFlags[ActivityFlags["INSTANCE"] = 1] = "INSTANCE";
742
- ActivityFlags[ActivityFlags["JOIn"] = 2] = "JOIn";
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";