@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 +2 -1
- package/src/errors/DJSError.ts +3 -3
- package/src/errors/ErrorCodes.ts +1 -1
- package/src/errors/Messages.ts +1 -1
- package/src/index.ts +1 -2
- package/src/util/Constants.ts +11 -11
- package/src/util/Events.ts +1 -1
- package/src/util/Options.ts +4 -6
- package/src/util/Partials.ts +1 -1
- package/src/util/ShardEvents.ts +1 -1
- package/src/util/Status.ts +1 -1
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
|
+
"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",
|
package/src/errors/DJSError.ts
CHANGED
|
@@ -45,6 +45,6 @@ export function message(code, args) {
|
|
|
45
45
|
return String(...args);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
export const DiscordjsError = makeDiscordjsError(Error);
|
|
49
|
+
export const DiscordjsTypeError = makeDiscordjsError(TypeError);
|
|
50
|
+
export const DiscordjsRangeError = makeDiscordjsError(RangeError);
|
package/src/errors/ErrorCodes.ts
CHANGED
package/src/errors/Messages.ts
CHANGED
|
@@ -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
|
|
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';
|
package/src/util/Constants.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { ChannelType, MessageType, ComponentType, ImageFormat, StickerFormatType
|
|
|
28
28
|
*
|
|
29
29
|
* @typedef {string} SweeperKey
|
|
30
30
|
*/
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
234
|
+
export const HolographicStyle = {
|
|
235
235
|
Primary: 11_127_295,
|
|
236
236
|
Secondary: 16_759_788,
|
|
237
237
|
Tertiary: 16_761_760,
|
package/src/util/Events.ts
CHANGED
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
* @type {Events}
|
|
92
92
|
* @ignore
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
export const Events = {
|
|
95
95
|
ApplicationCommandPermissionsUpdate: 'applicationCommandPermissionsUpdate',
|
|
96
96
|
AutoModerationActionExecution: 'autoModerationActionExecution',
|
|
97
97
|
AutoModerationRuleCreate: 'autoModerationRuleCreate',
|
package/src/util/Options.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { DefaultRestOptions, DefaultUserAgentAppendix } from '@ovencord/rest';
|
|
2
2
|
import { DefaultWebSocketManagerOptions } from '@ovencord/ws';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
package/src/util/Partials.ts
CHANGED
package/src/util/ShardEvents.ts
CHANGED
package/src/util/Status.ts
CHANGED