lunibee 0.3.3 → 0.4.0
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 +1 -1
- package/dist/builders/commands.d.ts +1 -1
- package/dist/builders/components.d.ts +9 -11
- package/dist/builders/embed.d.ts +1 -1
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +87 -1298
- package/dist/builders/index.js.map +3 -11
- package/dist/chunks/index-0wn81eng.js +2492 -0
- package/dist/chunks/index-0wn81eng.js.map +17 -0
- package/dist/chunks/index-2en489j6.js +40 -0
- package/dist/chunks/index-2en489j6.js.map +10 -0
- package/dist/chunks/index-3hyps48a.js +203 -0
- package/dist/chunks/index-3hyps48a.js.map +11 -0
- package/dist/chunks/index-57c5n3ms.js +2274 -0
- package/dist/chunks/index-57c5n3ms.js.map +19 -0
- package/dist/chunks/index-5yx92e36.js +1170 -0
- package/dist/chunks/index-5yx92e36.js.map +14 -0
- package/dist/chunks/index-690bp093.js +95 -0
- package/dist/chunks/index-690bp093.js.map +10 -0
- package/dist/chunks/index-7fp2hvmg.js +2155 -0
- package/dist/chunks/index-7fp2hvmg.js.map +24 -0
- package/dist/chunks/index-cnmsajvk.js +1119 -0
- package/dist/chunks/index-cnmsajvk.js.map +12 -0
- package/dist/chunks/index-fdvgk2sw.js +1310 -0
- package/dist/chunks/index-fdvgk2sw.js.map +21 -0
- package/dist/chunks/index-gyvps8b9.js +214 -0
- package/dist/chunks/index-gyvps8b9.js.map +12 -0
- package/dist/chunks/index-jzg4bh99.js +1533 -0
- package/dist/chunks/index-jzg4bh99.js.map +21 -0
- package/dist/chunks/index-mgw2yvrm.js +3547 -0
- package/dist/chunks/index-mgw2yvrm.js.map +25 -0
- package/dist/chunks/index-yh76b55h.js +3449 -0
- package/dist/chunks/index-yh76b55h.js.map +29 -0
- package/dist/collection/index.js +9 -1118
- package/dist/collection/index.js.map +3 -6
- package/dist/core/api.d.ts +3 -3
- package/dist/core/channel-create.d.ts +2 -2
- package/dist/core/commands.d.ts +3 -3
- package/dist/core/events.d.ts +4 -4
- package/dist/core/handles.d.ts +4 -4
- package/dist/core/index.d.ts +25 -20
- package/dist/core/index.js +68 -10130
- package/dist/core/index.js.map +3 -65
- package/dist/core/permissions.d.ts +1 -1
- package/dist/core/redis-cache.d.ts +1 -1
- package/dist/formatters/index.js +41 -110
- package/dist/formatters/index.js.map +3 -4
- package/dist/handlers/index.js +5 -37
- package/dist/handlers/index.js.map +3 -4
- package/dist/index.d.ts +21 -21
- package/dist/index.js +641 -16325
- package/dist/index.js.map +3 -92
- package/dist/managers/advanced.d.ts +3 -3
- package/dist/managers/application.d.ts +2 -2
- package/dist/managers/base.d.ts +1 -1
- package/dist/managers/emoji.d.ts +2 -2
- package/dist/managers/guild-resources.d.ts +6 -6
- package/dist/managers/guild.d.ts +3 -3
- package/dist/managers/index.d.ts +4 -8
- package/dist/managers/index.js +51 -4060
- package/dist/managers/index.js.map +3 -29
- package/dist/managers/member.d.ts +2 -2
- package/dist/managers/message.d.ts +14 -6
- package/dist/managers/role.d.ts +2 -2
- package/dist/managers/thread.d.ts +3 -3
- package/dist/managers/user.d.ts +7 -4
- package/dist/rest/index.d.ts +10 -35
- package/dist/rest/index.js +57 -2184
- package/dist/rest/index.js.map +3 -18
- package/dist/rest/limiter.d.ts +9 -1
- package/dist/rest/webhook.d.ts +2 -8
- package/dist/sharding/bus.d.ts +2 -2
- package/dist/sharding/cluster.d.ts +45 -5
- package/dist/sharding/context.d.ts +45 -3
- package/dist/sharding/gateway-bot.d.ts +2 -1
- package/dist/sharding/health.d.ts +1 -1
- package/dist/sharding/identify.d.ts +12 -0
- package/dist/sharding/index.d.ts +44 -11
- package/dist/sharding/index.js +60 -4620
- package/dist/sharding/index.js.map +3 -33
- package/dist/sharding/supervisor.d.ts +4 -2
- package/dist/structures/audit-log.d.ts +1 -1
- package/dist/structures/base.d.ts +6 -6
- package/dist/structures/channels.d.ts +1 -1
- package/dist/structures/embed.d.ts +1 -1
- package/dist/structures/index.d.ts +14 -14
- package/dist/structures/index.js +109 -2382
- package/dist/structures/index.js.map +3 -16
- package/dist/structures/interactions.d.ts +13 -9
- package/dist/structures/options.d.ts +1 -1
- package/dist/structures/permissions.d.ts +2 -2
- package/dist/structures/resources.d.ts +10 -10
- package/dist/structures/sticker.d.ts +1 -1
- package/dist/types/gateway.d.ts +2 -79
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.js +41 -272
- package/dist/types/index.js.map +3 -6
- package/dist/utils/index.js +23 -209
- package/dist/utils/index.js.map +3 -5
- package/dist/voice/connection.d.ts +200 -0
- package/dist/voice/crypto.d.ts +50 -0
- package/dist/voice/dave.d.ts +85 -0
- package/dist/voice/effects.d.ts +31 -0
- package/dist/voice/emitter.d.ts +14 -0
- package/dist/voice/gateway.d.ts +59 -0
- package/dist/voice/index.d.ts +25 -228
- package/dist/voice/index.js +111 -442
- package/dist/voice/index.js.map +3 -4
- package/dist/voice/libopus.d.ts +88 -0
- package/dist/voice/networking.d.ts +80 -0
- package/dist/voice/ogg.d.ts +24 -0
- package/dist/voice/opus.d.ts +18 -0
- package/dist/voice/player.d.ts +79 -0
- package/dist/voice/protocol.d.ts +76 -0
- package/dist/voice/receiver.d.ts +59 -0
- package/dist/voice/resource.d.ts +102 -0
- package/dist/voice/udp.d.ts +40 -0
- package/dist/ws/close-codes.d.ts +1 -1
- package/dist/ws/index.d.ts +25 -4
- package/dist/ws/index.js +47 -1336
- package/dist/ws/index.js.map +3 -17
- package/dist/ws/protocol.d.ts +1 -1
- package/dist/ws/send-budget.d.ts +0 -2
- package/dist/ws/state.d.ts +0 -10
- package/package.json +19 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type APIEntitlement, type InteractionReplyOptions } from "
|
|
1
|
+
import { type APIEntitlement, type InteractionReplyOptions } from "../types/index.js";
|
|
2
2
|
import { User, type ResourceContext } from "./base.js";
|
|
3
3
|
import { GuildMember } from "./resources.js";
|
|
4
4
|
import { Message } from "./index.js";
|
|
@@ -12,7 +12,7 @@ export declare const InteractionEnum: {
|
|
|
12
12
|
};
|
|
13
13
|
/** One {@link InteractionEnum} value, usable as a type. */
|
|
14
14
|
export type InteractionEnum = (typeof InteractionEnum)[keyof typeof InteractionEnum];
|
|
15
|
-
export { InteractionResponseEnum } from "
|
|
15
|
+
export { InteractionResponseEnum } from "../types/index.js";
|
|
16
16
|
/** Data shared by Discord interactions. */
|
|
17
17
|
export interface InteractionData {
|
|
18
18
|
/** Interaction identifier. */
|
|
@@ -38,12 +38,12 @@ export type { InteractionReplyOptions };
|
|
|
38
38
|
export interface InteractionClient {
|
|
39
39
|
/** Sends the initial interaction callback. @param id Interaction identifier. @param token Interaction token. @param response Callback payload. @returns Discord response. @throws {Error} When REST fails. */
|
|
40
40
|
postInteractionResponse(id: string, token: string, response: InteractionResponse): Promise<unknown>;
|
|
41
|
-
/** Edits the original interaction response. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */
|
|
42
|
-
editInteractionReply(token: string, data: InteractionReplyOptions): Promise<unknown>;
|
|
43
|
-
/** Deletes the original interaction response. @param token Interaction token. @returns Promise fulfilled after deletion. @throws {Error} When REST fails. */
|
|
44
|
-
deleteInteractionReply(token: string): Promise<void>;
|
|
45
|
-
/** Sends a follow-up interaction webhook message. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */
|
|
46
|
-
followUpInteraction(token: string, data: InteractionReplyOptions): Promise<unknown>;
|
|
41
|
+
/** Edits the original interaction response. @param token Interaction token. @param data Message payload. @param applicationId The interaction's `application_id`, which the webhook route needs. @returns Discord response. @throws {Error} When REST fails. */
|
|
42
|
+
editInteractionReply(token: string, data: InteractionReplyOptions, applicationId?: string): Promise<unknown>;
|
|
43
|
+
/** Deletes the original interaction response. @param token Interaction token. @param applicationId The interaction's `application_id`. @returns Promise fulfilled after deletion. @throws {Error} When REST fails. */
|
|
44
|
+
deleteInteractionReply(token: string, applicationId?: string): Promise<void>;
|
|
45
|
+
/** Sends a follow-up interaction webhook message. @param token Interaction token. @param data Message payload. @param applicationId The interaction's `application_id`. @returns Discord response. @throws {Error} When REST fails. */
|
|
46
|
+
followUpInteraction(token: string, data: InteractionReplyOptions, applicationId?: string): Promise<unknown>;
|
|
47
47
|
/** Reads, edits or deletes an interaction webhook message (`@original` or a follow-up ID). Optional; required for {@link Interaction.fetchReply}, {@link Interaction.editFollowUp} and {@link Interaction.deleteFollowUp}. */
|
|
48
48
|
interactionWebhookMessage?(method: "GET" | "PATCH" | "DELETE", applicationId: string, token: string, messageId: string, data?: InteractionReplyOptions): Promise<unknown>;
|
|
49
49
|
/** Lets structures built from an interaction (such as {@link Interaction.member}) act through the client. Optional. */
|
|
@@ -171,6 +171,8 @@ export declare class Interaction<TData extends InteractionData = InteractionData
|
|
|
171
171
|
deleteFollowUp(messageId: string): Promise<void>;
|
|
172
172
|
/** Ensures the interaction has been acknowledged. @returns Nothing. @throws {Error} When not acknowledged. */
|
|
173
173
|
protected assertAcknowledged(): void;
|
|
174
|
+
/** Ensures there is an original response message: a modal or autocomplete answer has none. @throws {Error} When not acknowledged, or answered without a message. */
|
|
175
|
+
protected assertHasReply(): void;
|
|
174
176
|
/** Posts a raw interaction response callback. */
|
|
175
177
|
protected postResponse(response: InteractionResponse): Promise<unknown>;
|
|
176
178
|
/**
|
|
@@ -204,7 +206,7 @@ export declare class Interaction<TData extends InteractionData = InteractionData
|
|
|
204
206
|
editReply(options: InteractionReplyOptions): Promise<unknown>;
|
|
205
207
|
/** Deletes the original response. @returns Promise fulfilled after deletion. @throws {Error} When not acknowledged or REST fails. */
|
|
206
208
|
deleteReply(): Promise<void>;
|
|
207
|
-
/** Sends a follow-up message using the interaction webhook. @param options Follow-up message options. @returns Discord response. @throws {Error} When REST fails. */
|
|
209
|
+
/** Sends a follow-up message using the interaction webhook. @param options Follow-up message options. @returns Discord response. @throws {Error} When not acknowledged (Discord has no webhook before the initial response) or REST fails. */
|
|
208
210
|
followUp(options: InteractionReplyOptions | string): Promise<unknown>;
|
|
209
211
|
/**
|
|
210
212
|
* Updates the message a component is on. With `withResponse: true` it
|
|
@@ -214,6 +216,8 @@ export declare class Interaction<TData extends InteractionData = InteractionData
|
|
|
214
216
|
withResponse: true;
|
|
215
217
|
}): Promise<Message | null>;
|
|
216
218
|
update(options: InteractionReplyOptions | string): Promise<unknown>;
|
|
219
|
+
/** Ensures a message-update response fits: a component, or a modal opened from one. @throws {Error} Otherwise. */
|
|
220
|
+
protected assertOnMessage(method: string): void;
|
|
217
221
|
/** Opens a modal dialog in the user's client. @param modal Modal builder output or raw modal callback data. @returns Discord response. @throws {Error} When already acknowledged or REST fails. */
|
|
218
222
|
showModal(modal: {
|
|
219
223
|
toJSON(): {
|
|
@@ -115,10 +115,10 @@ export declare const Permissions: {
|
|
|
115
115
|
};
|
|
116
116
|
/**
|
|
117
117
|
* Permission flag bits with **bigint** values matching Discord's permission bit
|
|
118
|
-
* positions
|
|
118
|
+
* positions, so bitwise composition
|
|
119
119
|
* (`Flags.A | Flags.B`) OR-s the bits instead of concatenating strings.
|
|
120
120
|
*
|
|
121
|
-
* The same object as {@link Permissions}, under
|
|
121
|
+
* The same object as {@link Permissions}, under another name. It is a
|
|
122
122
|
* `const` object rather than a TS `enum` because enums cannot hold bigint
|
|
123
123
|
* members; the same-named union type below preserves usage as a type.
|
|
124
124
|
*/
|
|
@@ -152,7 +152,7 @@ export declare class TextChannel extends Channel {
|
|
|
152
152
|
name?: string | null;
|
|
153
153
|
parent_id?: string | null;
|
|
154
154
|
guild_id?: string;
|
|
155
|
-
} & Partial<import("
|
|
155
|
+
} & Partial<import("../types/index.js").APIChannel>, context?: import("./base.js").ResourceContext);
|
|
156
156
|
/** Discord channel mention string. Used automatically in template literals. */
|
|
157
157
|
toString(): string;
|
|
158
158
|
}
|
|
@@ -272,7 +272,7 @@ export declare class Emoji extends BaseStructure {
|
|
|
272
272
|
id: string | null;
|
|
273
273
|
name: string | null;
|
|
274
274
|
roles?: string[];
|
|
275
|
-
user?: import("
|
|
275
|
+
user?: import("../types/index.js").UserData;
|
|
276
276
|
require_colons?: boolean;
|
|
277
277
|
managed?: boolean;
|
|
278
278
|
animated?: boolean;
|
|
@@ -291,12 +291,12 @@ export declare class AutoModerationRule extends BaseStructure {
|
|
|
291
291
|
eventType: number;
|
|
292
292
|
triggerType: number;
|
|
293
293
|
triggerMetadata: Record<string, unknown>;
|
|
294
|
-
actions: import("
|
|
294
|
+
actions: import("../types/index.js").APIAutoModerationAction[];
|
|
295
295
|
enabled: boolean;
|
|
296
296
|
exemptRoles: string[];
|
|
297
297
|
exemptChannels: string[];
|
|
298
298
|
/** Creates an auto moderation rule from Discord data. */
|
|
299
|
-
constructor(data: import("
|
|
299
|
+
constructor(data: import("../types/index.js").APIAutoModerationRule);
|
|
300
300
|
toJSON(): Record<string, unknown>;
|
|
301
301
|
}
|
|
302
302
|
/** A channel listed in a guild's Welcome Screen. */
|
|
@@ -305,22 +305,22 @@ export declare class WelcomeScreenChannel {
|
|
|
305
305
|
description: string;
|
|
306
306
|
emojiId: string | null;
|
|
307
307
|
emojiName: string | null;
|
|
308
|
-
constructor(data: import("
|
|
308
|
+
constructor(data: import("../types/index.js").APIWelcomeScreenChannel);
|
|
309
309
|
}
|
|
310
310
|
/** A Discord Guild Welcome Screen. */
|
|
311
311
|
export declare class GuildWelcomeScreen {
|
|
312
312
|
description: string | null;
|
|
313
313
|
channels: WelcomeScreenChannel[];
|
|
314
|
-
constructor(data: import("
|
|
314
|
+
constructor(data: import("../types/index.js").APIGuildWelcomeScreen);
|
|
315
315
|
}
|
|
316
316
|
/** An option within a Guild Onboarding Prompt. */
|
|
317
317
|
export declare class OnboardingPromptOption extends BaseStructure {
|
|
318
318
|
channelIds: string[];
|
|
319
319
|
roleIds: string[];
|
|
320
|
-
emoji: import("
|
|
320
|
+
emoji: import("../types/index.js").APIPartialEmoji | undefined;
|
|
321
321
|
title: string;
|
|
322
322
|
description: string | null;
|
|
323
|
-
constructor(data: import("
|
|
323
|
+
constructor(data: import("../types/index.js").APIOnboardingPromptOption);
|
|
324
324
|
}
|
|
325
325
|
/** A prompt shown during Guild Onboarding. */
|
|
326
326
|
export declare class OnboardingPrompt extends BaseStructure {
|
|
@@ -330,7 +330,7 @@ export declare class OnboardingPrompt extends BaseStructure {
|
|
|
330
330
|
singleSelect: boolean;
|
|
331
331
|
required: boolean;
|
|
332
332
|
inOnboarding: boolean;
|
|
333
|
-
constructor(data: import("
|
|
333
|
+
constructor(data: import("../types/index.js").APIOnboardingPrompt);
|
|
334
334
|
}
|
|
335
335
|
/** A Discord Guild Onboarding setup. */
|
|
336
336
|
export declare class GuildOnboarding extends BaseStructure {
|
|
@@ -338,5 +338,5 @@ export declare class GuildOnboarding extends BaseStructure {
|
|
|
338
338
|
defaultChannelIds: string[];
|
|
339
339
|
enabled: boolean;
|
|
340
340
|
mode: number;
|
|
341
|
-
constructor(data: import("
|
|
341
|
+
constructor(data: import("../types/index.js").APIGuildOnboarding);
|
|
342
342
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type APISticker, type APIStickerItem, type UserData } from "
|
|
1
|
+
import { type APISticker, type APIStickerItem, type UserData } from "../types/index.js";
|
|
2
2
|
import { BaseStructure } from "./base.js";
|
|
3
3
|
/** Where a sticker's image lives on Discord's CDN, by format. Lottie stickers are JSON, GIFs come from the media host. */
|
|
4
4
|
export declare function stickerURL(id: string, format: number, options?: {
|
package/dist/types/gateway.d.ts
CHANGED
|
@@ -51,35 +51,6 @@ export declare const IntentBits: {
|
|
|
51
51
|
readonly guildMessagePolls: number;
|
|
52
52
|
readonly directMessagePolls: number;
|
|
53
53
|
};
|
|
54
|
-
/** Alias for IntentBits. */
|
|
55
|
-
export declare const Intents: {
|
|
56
|
-
readonly guild: number;
|
|
57
|
-
readonly guilds: number;
|
|
58
|
-
readonly guildMembers: number;
|
|
59
|
-
readonly guildModeration: number;
|
|
60
|
-
readonly guildBans: number;
|
|
61
|
-
readonly guildExpressions: number;
|
|
62
|
-
readonly guildEmojis: number;
|
|
63
|
-
readonly guildEmojisAndStickers: number;
|
|
64
|
-
readonly guildIntegrations: number;
|
|
65
|
-
readonly guildWebhooks: number;
|
|
66
|
-
readonly guildInvites: number;
|
|
67
|
-
readonly guildVoiceStates: number;
|
|
68
|
-
readonly guildPresences: number;
|
|
69
|
-
readonly guildMessages: number;
|
|
70
|
-
readonly guildMessage: number;
|
|
71
|
-
readonly guildMessageReactions: number;
|
|
72
|
-
readonly guildMessageTyping: number;
|
|
73
|
-
readonly directMessages: number;
|
|
74
|
-
readonly directMessageReactions: number;
|
|
75
|
-
readonly directMessageTyping: number;
|
|
76
|
-
readonly messageContent: number;
|
|
77
|
-
readonly guildScheduledEvents: number;
|
|
78
|
-
readonly autoModerationConfiguration: number;
|
|
79
|
-
readonly autoModerationExecution: number;
|
|
80
|
-
readonly guildMessagePolls: number;
|
|
81
|
-
readonly directMessagePolls: number;
|
|
82
|
-
};
|
|
83
54
|
/** Gateway intents: an array of intent bits or names, e.g. `[GatewayIntentBits.Guilds, "GuildMessages"]`. A single number, name or OR-ed bitfield is not accepted. */
|
|
84
55
|
export type GatewayIntentResolvable = readonly (number | keyof typeof GatewayIntentBits | keyof typeof IntentBits | string)[];
|
|
85
56
|
/**
|
|
@@ -87,55 +58,6 @@ export type GatewayIntentResolvable = readonly (number | keyof typeof GatewayInt
|
|
|
87
58
|
* @throws {TypeError} If `intents` is not an array (an OR-ed number, a single name or a bitfield object).
|
|
88
59
|
*/
|
|
89
60
|
export declare function resolveGatewayIntents(intents: GatewayIntentResolvable): number;
|
|
90
|
-
/** What `IntentsBitField` methods take: one intent or an array of them. Clients and gateways take only arrays. */
|
|
91
|
-
type IntentsInput = GatewayIntentResolvable[number] | GatewayIntentResolvable;
|
|
92
|
-
/**
|
|
93
|
-
* Discord.js-familiar intent bitfield.
|
|
94
|
-
* @example new IntentsBitField([IntentsBitField.Flags.Guilds, "GuildMessages"])
|
|
95
|
-
*/
|
|
96
|
-
export declare class IntentsBitField {
|
|
97
|
-
/** Intent flag values by name. */
|
|
98
|
-
static readonly Flags: {
|
|
99
|
-
readonly Guilds: number;
|
|
100
|
-
readonly GuildMembers: number;
|
|
101
|
-
readonly GuildModeration: number;
|
|
102
|
-
readonly GuildExpressions: number;
|
|
103
|
-
readonly GuildIntegrations: number;
|
|
104
|
-
readonly GuildWebhooks: number;
|
|
105
|
-
readonly GuildInvites: number;
|
|
106
|
-
readonly GuildVoiceStates: number;
|
|
107
|
-
readonly GuildPresences: number;
|
|
108
|
-
readonly GuildMessages: number;
|
|
109
|
-
readonly GuildMessageReactions: number;
|
|
110
|
-
readonly GuildMessageTyping: number;
|
|
111
|
-
readonly DirectMessages: number;
|
|
112
|
-
readonly DirectMessageReactions: number;
|
|
113
|
-
readonly DirectMessageTyping: number;
|
|
114
|
-
readonly MessageContent: number;
|
|
115
|
-
readonly GuildScheduledEvents: number;
|
|
116
|
-
readonly AutoModerationConfiguration: number;
|
|
117
|
-
readonly AutoModerationExecution: number;
|
|
118
|
-
readonly GuildMessagePolls: number;
|
|
119
|
-
readonly DirectMessagePolls: number;
|
|
120
|
-
};
|
|
121
|
-
/** Raw intent bitfield. */
|
|
122
|
-
bitfield: number;
|
|
123
|
-
constructor(bits?: IntentsInput);
|
|
124
|
-
/** Whether every given intent is set. */
|
|
125
|
-
has(bits: IntentsInput): boolean;
|
|
126
|
-
/** Whether any given intent is set. */
|
|
127
|
-
any(bits: IntentsInput): boolean;
|
|
128
|
-
/** Adds intents in place. @returns This bitfield. */
|
|
129
|
-
add(...bits: IntentsInput[]): this;
|
|
130
|
-
/** Removes intents in place. @returns This bitfield. */
|
|
131
|
-
remove(...bits: IntentsInput[]): this;
|
|
132
|
-
/** Names of the set intents. */
|
|
133
|
-
toArray(): (keyof typeof GatewayIntentBits)[];
|
|
134
|
-
/** Whether this equals another bitfield. */
|
|
135
|
-
equals(bits: IntentsInput): boolean;
|
|
136
|
-
valueOf(): number;
|
|
137
|
-
toJSON(): number;
|
|
138
|
-
}
|
|
139
61
|
/** Gateway connection properties (OS, browser, device). */
|
|
140
62
|
export interface GatewayProperties {
|
|
141
63
|
os?: string;
|
|
@@ -188,6 +110,8 @@ export interface ClientOptions {
|
|
|
188
110
|
presences?: boolean;
|
|
189
111
|
/** Most members kept per guild (least recently used leave first). Default: unbounded, so a big guild's member list stays whole. */
|
|
190
112
|
maxMembers?: number;
|
|
113
|
+
/** Most users kept in `client.users` (least recently used leave first). Default: unbounded. */
|
|
114
|
+
maxUsers?: number;
|
|
191
115
|
};
|
|
192
116
|
/**
|
|
193
117
|
* Default `allowed_mentions` for every message the client sends (channel
|
|
@@ -227,4 +151,3 @@ export interface RESTOptions {
|
|
|
227
151
|
/** Allow a cleartext `http://` `baseURL` on a network you trust, such as a REST proxy. Default false. */
|
|
228
152
|
allowInsecureBaseURL?: boolean;
|
|
229
153
|
}
|
|
230
|
-
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,8 +14,6 @@ export interface UserData {
|
|
|
14
14
|
system?: boolean;
|
|
15
15
|
public_flags?: number;
|
|
16
16
|
}
|
|
17
|
-
/** Current authenticated bot user. */
|
|
18
|
-
export type ClientUser = UserData;
|
|
19
17
|
/** Discord Gateway payload envelope. */
|
|
20
18
|
export interface GatewayPayload<T = unknown> {
|
|
21
19
|
op: number;
|
|
@@ -332,10 +330,6 @@ export interface InteractionReplyOptions extends MessagePayload {
|
|
|
332
330
|
/** On `reply()` / `update()`: return the created message (one request, no `fetchReply()`). */
|
|
333
331
|
withResponse?: boolean;
|
|
334
332
|
}
|
|
335
|
-
/** What `update()` on a component interaction takes. */
|
|
336
|
-
export type InteractionUpdateOptions = InteractionReplyOptions;
|
|
337
|
-
/** What `followUp()` takes. */
|
|
338
|
-
export type FollowUpOptions = InteractionReplyOptions;
|
|
339
333
|
/** Raw Discord attachment object. */
|
|
340
334
|
export interface APIAttachment {
|
|
341
335
|
id: Snowflake;
|
package/dist/types/index.js
CHANGED
|
@@ -1,276 +1,45 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
// packages/types/src/gateway.ts
|
|
24
|
-
var GatewayIntentBits = {
|
|
25
|
-
Guilds: 1 << 0,
|
|
26
|
-
GuildMembers: 1 << 1,
|
|
27
|
-
GuildModeration: 1 << 2,
|
|
28
|
-
GuildExpressions: 1 << 3,
|
|
29
|
-
GuildIntegrations: 1 << 4,
|
|
30
|
-
GuildWebhooks: 1 << 5,
|
|
31
|
-
GuildInvites: 1 << 6,
|
|
32
|
-
GuildVoiceStates: 1 << 7,
|
|
33
|
-
GuildPresences: 1 << 8,
|
|
34
|
-
GuildMessages: 1 << 9,
|
|
35
|
-
GuildMessageReactions: 1 << 10,
|
|
36
|
-
GuildMessageTyping: 1 << 11,
|
|
37
|
-
DirectMessages: 1 << 12,
|
|
38
|
-
DirectMessageReactions: 1 << 13,
|
|
39
|
-
DirectMessageTyping: 1 << 14,
|
|
40
|
-
MessageContent: 1 << 15,
|
|
41
|
-
GuildScheduledEvents: 1 << 16,
|
|
42
|
-
AutoModerationConfiguration: 1 << 20,
|
|
43
|
-
AutoModerationExecution: 1 << 21,
|
|
44
|
-
GuildMessagePolls: 1 << 24,
|
|
45
|
-
DirectMessagePolls: 1 << 25
|
|
46
|
-
};
|
|
47
|
-
var IntentBits = {
|
|
48
|
-
guild: 1 << 0,
|
|
49
|
-
guilds: 1 << 0,
|
|
50
|
-
guildMembers: 1 << 1,
|
|
51
|
-
guildModeration: 1 << 2,
|
|
52
|
-
guildBans: 1 << 2,
|
|
53
|
-
guildExpressions: 1 << 3,
|
|
54
|
-
guildEmojis: 1 << 3,
|
|
55
|
-
guildEmojisAndStickers: 1 << 3,
|
|
56
|
-
guildIntegrations: 1 << 4,
|
|
57
|
-
guildWebhooks: 1 << 5,
|
|
58
|
-
guildInvites: 1 << 6,
|
|
59
|
-
guildVoiceStates: 1 << 7,
|
|
60
|
-
guildPresences: 1 << 8,
|
|
61
|
-
guildMessages: 1 << 9,
|
|
62
|
-
guildMessage: 1 << 9,
|
|
63
|
-
guildMessageReactions: 1 << 10,
|
|
64
|
-
guildMessageTyping: 1 << 11,
|
|
65
|
-
directMessages: 1 << 12,
|
|
66
|
-
directMessageReactions: 1 << 13,
|
|
67
|
-
directMessageTyping: 1 << 14,
|
|
68
|
-
messageContent: 1 << 15,
|
|
69
|
-
guildScheduledEvents: 1 << 16,
|
|
70
|
-
autoModerationConfiguration: 1 << 20,
|
|
71
|
-
autoModerationExecution: 1 << 21,
|
|
72
|
-
guildMessagePolls: 1 << 24,
|
|
73
|
-
directMessagePolls: 1 << 25
|
|
74
|
-
};
|
|
75
|
-
var Intents = IntentBits;
|
|
76
|
-
function resolveGatewayIntents(intents) {
|
|
77
|
-
if (!Array.isArray(intents))
|
|
78
|
-
throw new TypeError("Gateway intents must be an array, e.g. [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages].");
|
|
79
|
-
return intents.reduce((acc, intent) => acc | resolveIntent(intent), 0);
|
|
80
|
-
}
|
|
81
|
-
function resolveIntent(intent) {
|
|
82
|
-
if (typeof intent === "number")
|
|
83
|
-
return intent;
|
|
84
|
-
const bits = {
|
|
85
|
-
...IntentBits,
|
|
86
|
-
...GatewayIntentBits
|
|
87
|
-
};
|
|
88
|
-
const lower = intent.charAt(0).toLowerCase() + intent.slice(1);
|
|
89
|
-
if (Object.hasOwn(bits, intent))
|
|
90
|
-
return bits[intent];
|
|
91
|
-
if (Object.hasOwn(bits, lower))
|
|
92
|
-
return bits[lower];
|
|
93
|
-
const num = Number(intent);
|
|
94
|
-
return Number.isNaN(num) ? 0 : num;
|
|
95
|
-
}
|
|
96
|
-
function resolveInput(bits) {
|
|
97
|
-
return resolveGatewayIntents(Array.isArray(bits) ? bits : [bits]);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
class IntentsBitField {
|
|
101
|
-
static Flags = GatewayIntentBits;
|
|
102
|
-
bitfield;
|
|
103
|
-
constructor(bits = []) {
|
|
104
|
-
this.bitfield = resolveInput(bits);
|
|
105
|
-
}
|
|
106
|
-
has(bits) {
|
|
107
|
-
const resolved = resolveInput(bits);
|
|
108
|
-
return (this.bitfield & resolved) === resolved;
|
|
109
|
-
}
|
|
110
|
-
any(bits) {
|
|
111
|
-
return (this.bitfield & resolveInput(bits)) !== 0;
|
|
112
|
-
}
|
|
113
|
-
add(...bits) {
|
|
114
|
-
for (const bit of bits)
|
|
115
|
-
this.bitfield |= resolveInput(bit);
|
|
116
|
-
return this;
|
|
117
|
-
}
|
|
118
|
-
remove(...bits) {
|
|
119
|
-
for (const bit of bits)
|
|
120
|
-
this.bitfield &= ~resolveInput(bit);
|
|
121
|
-
return this;
|
|
122
|
-
}
|
|
123
|
-
toArray() {
|
|
124
|
-
return Object.keys(GatewayIntentBits).filter((name) => this.has(GatewayIntentBits[name]));
|
|
125
|
-
}
|
|
126
|
-
equals(bits) {
|
|
127
|
-
return this.bitfield === resolveInput(bits);
|
|
128
|
-
}
|
|
129
|
-
valueOf() {
|
|
130
|
-
return this.bitfield;
|
|
131
|
-
}
|
|
132
|
-
toJSON() {
|
|
133
|
-
return this.bitfield;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// packages/types/src/index.ts
|
|
138
|
-
var MessageFlags = {
|
|
139
|
-
Crossposted: 1,
|
|
140
|
-
IsCrosspost: 2,
|
|
141
|
-
SuppressEmbeds: 4,
|
|
142
|
-
SourceMessageDeleted: 8,
|
|
143
|
-
Urgent: 16,
|
|
144
|
-
HasThread: 32,
|
|
145
|
-
Ephemeral: 64,
|
|
146
|
-
Loading: 128,
|
|
147
|
-
IsComponentsV2: 32768
|
|
148
|
-
};
|
|
149
|
-
var ChannelEnum = {
|
|
150
|
-
GuildText: 0,
|
|
151
|
-
DM: 1,
|
|
152
|
-
GuildVoice: 2,
|
|
153
|
-
GroupDM: 3,
|
|
154
|
-
GuildCategory: 4,
|
|
155
|
-
GuildAnnouncement: 5,
|
|
156
|
-
AnnouncementThread: 10,
|
|
157
|
-
PublicThread: 11,
|
|
158
|
-
PrivateThread: 12,
|
|
159
|
-
GuildStageVoice: 13,
|
|
160
|
-
GuildDirectory: 14,
|
|
161
|
-
GuildForum: 15,
|
|
162
|
-
GuildMedia: 16
|
|
163
|
-
};
|
|
164
|
-
var ComponentEnum = {
|
|
165
|
-
ActionRow: 1,
|
|
166
|
-
Button: 2,
|
|
167
|
-
StringSelect: 3,
|
|
168
|
-
TextInput: 4,
|
|
169
|
-
UserSelect: 5,
|
|
170
|
-
RoleSelect: 6,
|
|
171
|
-
MentionableSelect: 7,
|
|
172
|
-
ChannelSelect: 8,
|
|
173
|
-
Section: 9,
|
|
174
|
-
TextDisplay: 10,
|
|
175
|
-
Thumbnail: 11,
|
|
176
|
-
MediaGallery: 12,
|
|
177
|
-
File: 13,
|
|
178
|
-
Separator: 14,
|
|
179
|
-
ContentInventoryEntry: 16,
|
|
180
|
-
Container: 17
|
|
181
|
-
};
|
|
182
|
-
var ButtonType = {
|
|
183
|
-
Primary: 1,
|
|
184
|
-
Secondary: 2,
|
|
185
|
-
Success: 3,
|
|
186
|
-
Danger: 4,
|
|
187
|
-
Link: 5,
|
|
188
|
-
Premium: 6
|
|
189
|
-
};
|
|
190
|
-
var TextInputType = {
|
|
191
|
-
Short: 1,
|
|
192
|
-
Paragraph: 2
|
|
193
|
-
};
|
|
194
|
-
var InteractionResponseEnum = {
|
|
195
|
-
Pong: 1,
|
|
196
|
-
ChannelMessage: 4,
|
|
197
|
-
DeferredChannelMessage: 5,
|
|
198
|
-
DeferredMessageUpdate: 6,
|
|
199
|
-
MessageUpdate: 7,
|
|
200
|
-
Autocomplete: 8,
|
|
201
|
-
Modal: 9
|
|
202
|
-
};
|
|
203
|
-
var StickerFormatEnum = {
|
|
204
|
-
PNG: 1,
|
|
205
|
-
APNG: 2,
|
|
206
|
-
Lottie: 3,
|
|
207
|
-
GIF: 4
|
|
208
|
-
};
|
|
209
|
-
var StickerEnum = {
|
|
210
|
-
Standard: 1,
|
|
211
|
-
Guild: 2
|
|
212
|
-
};
|
|
213
|
-
var VerificationLevel = {
|
|
214
|
-
None: 0,
|
|
215
|
-
Low: 1,
|
|
216
|
-
Medium: 2,
|
|
217
|
-
High: 3,
|
|
218
|
-
VeryHigh: 4
|
|
219
|
-
};
|
|
220
|
-
var PremiumTier = {
|
|
221
|
-
None: 0,
|
|
222
|
-
Tier1: 1,
|
|
223
|
-
Tier2: 2,
|
|
224
|
-
Tier3: 3
|
|
225
|
-
};
|
|
226
|
-
var ActivityEnum = {
|
|
227
|
-
Playing: 0,
|
|
228
|
-
Streaming: 1,
|
|
229
|
-
Listening: 2,
|
|
230
|
-
Watching: 3,
|
|
231
|
-
Custom: 4,
|
|
232
|
-
Competing: 5
|
|
233
|
-
};
|
|
234
|
-
var ApplicationCommandOptionEnum = {
|
|
235
|
-
SubCommand: 1,
|
|
236
|
-
SubCommandGroup: 2,
|
|
237
|
-
String: 3,
|
|
238
|
-
Integer: 4,
|
|
239
|
-
Boolean: 5,
|
|
240
|
-
User: 6,
|
|
241
|
-
Channel: 7,
|
|
242
|
-
Role: 8,
|
|
243
|
-
Mentionable: 9,
|
|
244
|
-
Number: 10,
|
|
245
|
-
Attachment: 11
|
|
246
|
-
};
|
|
247
|
-
var ApplicationCommandEnum = {
|
|
248
|
-
ChatInput: 1,
|
|
249
|
-
User: 2,
|
|
250
|
-
Message: 3
|
|
251
|
-
};
|
|
2
|
+
import {
|
|
3
|
+
ChannelKinds2,
|
|
4
|
+
channelKindOf2,
|
|
5
|
+
channelTypesOf2,
|
|
6
|
+
GatewayIntentBits2,
|
|
7
|
+
IntentBits2,
|
|
8
|
+
resolveGatewayIntents2,
|
|
9
|
+
MessageFlags2,
|
|
10
|
+
ChannelEnum2,
|
|
11
|
+
ComponentEnum2,
|
|
12
|
+
ButtonType2,
|
|
13
|
+
TextInputType3,
|
|
14
|
+
InteractionResponseEnum2,
|
|
15
|
+
StickerFormatEnum2,
|
|
16
|
+
StickerEnum2,
|
|
17
|
+
VerificationLevel2,
|
|
18
|
+
PremiumTier2,
|
|
19
|
+
ActivityEnum2,
|
|
20
|
+
ApplicationCommandOptionEnum3,
|
|
21
|
+
ApplicationCommandEnum2
|
|
22
|
+
} from "../chunks/index-gyvps8b9.js";
|
|
252
23
|
export {
|
|
253
|
-
ActivityEnum,
|
|
254
|
-
ApplicationCommandEnum,
|
|
255
|
-
ApplicationCommandOptionEnum,
|
|
256
|
-
ButtonType,
|
|
257
|
-
ChannelEnum,
|
|
258
|
-
ChannelKinds,
|
|
259
|
-
ComponentEnum,
|
|
260
|
-
GatewayIntentBits,
|
|
261
|
-
IntentBits,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
channelTypesOf,
|
|
273
|
-
resolveGatewayIntents
|
|
24
|
+
ActivityEnum2 as ActivityEnum,
|
|
25
|
+
ApplicationCommandEnum2 as ApplicationCommandEnum,
|
|
26
|
+
ApplicationCommandOptionEnum3 as ApplicationCommandOptionEnum,
|
|
27
|
+
ButtonType2 as ButtonType,
|
|
28
|
+
ChannelEnum2 as ChannelEnum,
|
|
29
|
+
ChannelKinds2 as ChannelKinds,
|
|
30
|
+
ComponentEnum2 as ComponentEnum,
|
|
31
|
+
GatewayIntentBits2 as GatewayIntentBits,
|
|
32
|
+
IntentBits2 as IntentBits,
|
|
33
|
+
InteractionResponseEnum2 as InteractionResponseEnum,
|
|
34
|
+
MessageFlags2 as MessageFlags,
|
|
35
|
+
PremiumTier2 as PremiumTier,
|
|
36
|
+
StickerEnum2 as StickerEnum,
|
|
37
|
+
StickerFormatEnum2 as StickerFormatEnum,
|
|
38
|
+
TextInputType3 as TextInputType,
|
|
39
|
+
VerificationLevel2 as VerificationLevel,
|
|
40
|
+
channelKindOf2 as channelKindOf,
|
|
41
|
+
channelTypesOf2 as channelTypesOf,
|
|
42
|
+
resolveGatewayIntents2 as resolveGatewayIntents
|
|
274
43
|
};
|
|
275
44
|
|
|
276
|
-
//# debugId=
|
|
45
|
+
//# debugId=A2ACE491C6D774C664756E2164756E21
|