@ovencord/discord.js 14.16.4 → 14.16.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ovencord/discord.js",
4
- "version": "14.16.4",
4
+ "version": "14.16.6",
5
5
  "description": "A powerful library for interacting with the Discord API",
6
6
  "scripts": {
7
7
  "test": "bun test",
@@ -37,6 +37,7 @@
37
37
  "homepage": "https://ovencord.dev",
38
38
  "funding": "https://github.com/ovencord/ovencord?sponsor",
39
39
  "dependencies": {
40
+ "tslib": "^2.6.2",
40
41
  "@sapphire/snowflake": "3.5.5",
41
42
  "@vladfrangu/async_event_emitter": "^2.4.7",
42
43
  "discord-api-types": "^0.38.36",
@@ -45,6 +45,6 @@ export function message(code, args) {
45
45
  return String(...args);
46
46
  }
47
47
 
48
- exports.DiscordjsError = makeDiscordjsError(Error);
49
- exports.DiscordjsTypeError = makeDiscordjsError(TypeError);
50
- exports.DiscordjsRangeError = makeDiscordjsError(RangeError);
48
+ export const DiscordjsError = makeDiscordjsError(Error);
49
+ export const DiscordjsTypeError = makeDiscordjsError(TypeError);
50
+ export const DiscordjsRangeError = makeDiscordjsError(RangeError);
@@ -274,4 +274,4 @@ const keys = [
274
274
  * @type {DiscordjsErrorCodes}
275
275
  * @ignore
276
276
  */
277
- const ErrorCodes = Object.fromEntries(keys.map(key => [key, key]));
277
+ export const ErrorCodes = Object.fromEntries(keys.map(key => [key, key]));
@@ -1,6 +1,6 @@
1
1
  import { ErrorCodes } from './ErrorCodes.js';
2
2
 
3
- const Messages = {
3
+ export const Messages = {
4
4
  [ErrorCodes.ClientInvalidOption]: (prop, must) => `The ${prop} option must be ${must}`,
5
5
  [ErrorCodes.ClientInvalidProvidedShards]: 'None of the provided shards were valid.',
6
6
  [ErrorCodes.ClientMissingIntents]: 'Valid intents must be provided for the Client.',
package/src/index.ts CHANGED
@@ -56,7 +56,7 @@ export { resolveColor } from './util/Util.js';
56
56
  export { resolveSKUId } from './util/Util.js';
57
57
  export { verifyString } from './util/Util.js';
58
58
 
59
- export { version } from '../package.json.js';
59
+ export { version } from '../package.json' with { type: 'json' };
60
60
 
61
61
  // Managers
62
62
  export { ApplicationCommandManager } from './managers/ApplicationCommandManager.js';
@@ -173,7 +173,6 @@ export { MediaGalleryComponent } from './structures/MediaGalleryComponent.js';
173
173
  export { MediaGalleryItem } from './structures/MediaGalleryItem.js';
174
174
  export { MentionableSelectMenuComponent } from './structures/MentionableSelectMenuComponent.js';
175
175
  export { MentionableSelectMenuInteraction } from './structures/MentionableSelectMenuInteraction.js';
176
- export { MentionableSelectMenuInteraction } from './structures/MentionableSelectMenuInteraction.js';
177
176
  export { Message } from './structures/Message.js';
178
177
  export { MessageCollector } from './structures/MessageCollector.js';
179
178
  export { MessageComponentInteraction } from './structures/MessageComponentInteraction.js';
@@ -28,7 +28,7 @@ import { ChannelType, MessageType, ComponentType, ImageFormat, StickerFormatType
28
28
  *
29
29
  * @typedef {string} SweeperKey
30
30
  */
31
- exports.SweeperKeys = [
31
+ export const SweeperKeys = [
32
32
  'autoModerationRules',
33
33
  'applicationCommands',
34
34
  'bans',
@@ -56,7 +56,7 @@ exports.SweeperKeys = [
56
56
  *
57
57
  * @typedef {MessageType[]} NonSystemMessageTypes
58
58
  */
59
- exports.NonSystemMessageTypes = [
59
+ export const NonSystemMessageTypes = [
60
60
  MessageType.Default,
61
61
  MessageType.Reply,
62
62
  MessageType.ChatInputCommand,
@@ -86,7 +86,7 @@ exports.NonSystemMessageTypes = [
86
86
  *
87
87
  * @typedef {ChannelType[]} GuildTextBasedChannelTypes
88
88
  */
89
- exports.GuildTextBasedChannelTypes = [
89
+ export const GuildTextBasedChannelTypes = [
90
90
  ChannelType.GuildText,
91
91
  ChannelType.GuildAnnouncement,
92
92
  ChannelType.AnnouncementThread,
@@ -126,7 +126,7 @@ exports.GuildTextBasedChannelTypes = [
126
126
  *
127
127
  * @typedef {ChannelType[]} TextBasedChannelTypes
128
128
  */
129
- exports.TextBasedChannelTypes = [...exports.GuildTextBasedChannelTypes, ChannelType.DM, ChannelType.GroupDM];
129
+ export const TextBasedChannelTypes = [...GuildTextBasedChannelTypes, ChannelType.DM, ChannelType.GroupDM];
130
130
 
131
131
  /**
132
132
  * The types of channels that are text-based and can have messages sent into. The available types are:
@@ -141,7 +141,7 @@ exports.TextBasedChannelTypes = [...exports.GuildTextBasedChannelTypes, ChannelT
141
141
  *
142
142
  * @typedef {ChannelType[]} SendableChannels
143
143
  */
144
- exports.SendableChannels = [...exports.GuildTextBasedChannelTypes, ChannelType.DM];
144
+ export const SendableChannels = [...GuildTextBasedChannelTypes, ChannelType.DM];
145
145
 
146
146
  /**
147
147
  * The types of channels that are threads. The available types are:
@@ -151,7 +151,7 @@ exports.SendableChannels = [...exports.GuildTextBasedChannelTypes, ChannelType.D
151
151
  *
152
152
  * @typedef {ChannelType[]} ThreadChannelTypes
153
153
  */
154
- exports.ThreadChannelTypes = [ChannelType.AnnouncementThread, ChannelType.PublicThread, ChannelType.PrivateThread];
154
+ export const ThreadChannelTypes = [ChannelType.AnnouncementThread, ChannelType.PublicThread, ChannelType.PrivateThread];
155
155
 
156
156
  /**
157
157
  * The types of channels that are voice-based. The available types are:
@@ -160,7 +160,7 @@ exports.ThreadChannelTypes = [ChannelType.AnnouncementThread, ChannelType.Public
160
160
  *
161
161
  * @typedef {ChannelType[]} VoiceBasedChannelTypes
162
162
  */
163
- exports.VoiceBasedChannelTypes = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
163
+ export const VoiceBasedChannelTypes = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
164
164
 
165
165
  /**
166
166
  * The types of select menus. The available types are:
@@ -172,7 +172,7 @@ exports.VoiceBasedChannelTypes = [ChannelType.GuildVoice, ChannelType.GuildStage
172
172
  *
173
173
  * @typedef {ComponentType[]} SelectMenuTypes
174
174
  */
175
- exports.SelectMenuTypes = [
175
+ export const SelectMenuTypes = [
176
176
  ComponentType.StringSelect,
177
177
  ComponentType.UserSelect,
178
178
  ComponentType.RoleSelect,
@@ -191,7 +191,7 @@ exports.SelectMenuTypes = [
191
191
  *
192
192
  * @typedef {MessageType[]} UndeletableMessageTypes
193
193
  */
194
- exports.UndeletableMessageTypes = [
194
+ export const UndeletableMessageTypes = [
195
195
  MessageType.RecipientAdd,
196
196
  MessageType.RecipientRemove,
197
197
  MessageType.Call,
@@ -214,7 +214,7 @@ exports.UndeletableMessageTypes = [
214
214
  * @property {"json"} 3 Lottie
215
215
  * @property {"gif"} 4 GIF
216
216
  */
217
- exports.StickerFormatExtensionMap = {
217
+ export const StickerFormatExtensionMap = {
218
218
  [StickerFormatType.PNG]: ImageFormat.PNG,
219
219
  [StickerFormatType.APNG]: ImageFormat.PNG,
220
220
  [StickerFormatType.Lottie]: ImageFormat.Lottie,
@@ -231,7 +231,7 @@ exports.StickerFormatExtensionMap = {
231
231
  * @property {number} Secondary 16759788 (0xFFCCCC)
232
232
  * @property {number} Tertiary 16761760 (0xFFE0A0)
233
233
  */
234
- exports.HolographicStyle = {
234
+ export const HolographicStyle = {
235
235
  Primary: 11_127_295,
236
236
  Secondary: 16_759_788,
237
237
  Tertiary: 16_761_760,
@@ -91,7 +91,7 @@
91
91
  * @type {Events}
92
92
  * @ignore
93
93
  */
94
- exports.Events = {
94
+ export const Events = {
95
95
  ApplicationCommandPermissionsUpdate: 'applicationCommandPermissionsUpdate',
96
96
  AutoModerationActionExecution: 'autoModerationActionExecution',
97
97
  AutoModerationRuleCreate: 'autoModerationRuleCreate',
@@ -1,7 +1,9 @@
1
1
  import { DefaultRestOptions, DefaultUserAgentAppendix } from '@ovencord/rest';
2
2
  import { DefaultWebSocketManagerOptions } from '@ovencord/ws';
3
- import { version } from '../../package.json.js';
4
- import { toSnakeCase } from './Transformers.js';
3
+ import { Collection } from '@ovencord/collection';
4
+ import { version } from '../../package.json' with { type: 'json' };
5
+ import { LimitedCollection } from './LimitedCollection.js';
6
+ import { toSnakeCase } from './Transformers.js';
5
7
 
6
8
  /**
7
9
  * @typedef {Object} CacheFactoryParams
@@ -120,9 +122,6 @@ export class Options extends null {
120
122
  * });
121
123
  */
122
124
  static cacheWithLimits(settings = {}) {
123
- import { Collection } from '@ovencord/collection';
124
- import { LimitedCollection } from './LimitedCollection.js';
125
-
126
125
  return ({ managerType, manager }) => {
127
126
  const setting = settings[manager.name] ?? settings[managerType.name];
128
127
  /* eslint-disable-next-line eqeqeq */
@@ -154,7 +153,6 @@ export class Options extends null {
154
153
  * @returns {CacheFactory}
155
154
  */
156
155
  static cacheEverything() {
157
- import { Collection } from '@ovencord/collection';
158
156
  return () => new Collection();
159
157
  }
160
158
 
@@ -36,7 +36,7 @@ import { createEnum } from './Enums.js';
36
36
  * @type {Partials}
37
37
  * @ignore
38
38
  */
39
- exports.Partials = createEnum([
39
+ export const Partials = createEnum([
40
40
  'User',
41
41
  'Channel',
42
42
  'GuildMember',
@@ -15,7 +15,7 @@
15
15
  * @type {ShardEvents}
16
16
  * @ignore
17
17
  */
18
- exports.ShardEvents = {
18
+ export const ShardEvents = {
19
19
  Death: 'death',
20
20
  Disconnect: 'disconnect',
21
21
  Error: 'error',
@@ -13,4 +13,4 @@ import { createEnum } from './Enums.js';
13
13
  * @type {Status}
14
14
  * @ignore
15
15
  */
16
- exports.Status = createEnum(['Ready', 'Idle', 'WaitingForGuilds']);
16
+ export const Status = createEnum(['Ready', 'Idle', 'WaitingForGuilds']);