lunibee 0.1.4 → 0.1.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/README.md +12 -23
- package/dist/builders/components.d.ts +108 -0
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +178 -2
- package/dist/builders/index.js.map +3 -3
- package/dist/collection/index.d.ts +6 -0
- package/dist/collection/index.js +33 -2
- package/dist/collection/index.js.map +4 -4
- package/dist/core/events.d.ts +67 -3
- package/dist/core/index.d.ts +120 -90
- package/dist/core/index.js +816 -1021
- package/dist/core/index.js.map +20 -21
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2215 -1392
- package/dist/index.js.map +29 -26
- package/dist/managers/guild.d.ts +30 -0
- package/dist/managers/index.d.ts +56 -75
- package/dist/managers/index.js +339 -48
- package/dist/managers/index.js.map +16 -12
- package/dist/managers/message.d.ts +7 -12
- package/dist/managers/user.d.ts +20 -0
- package/dist/rest/index.d.ts +83 -1
- package/dist/rest/index.js +48 -8
- package/dist/rest/index.js.map +4 -4
- package/dist/rest/routes.d.ts +4 -1
- package/dist/sharding/index.js +4 -1
- package/dist/sharding/index.js.map +4 -4
- package/dist/structures/base.d.ts +99 -48
- package/dist/structures/embed.d.ts +65 -0
- package/dist/structures/index.d.ts +45 -25
- package/dist/structures/index.js +569 -36
- package/dist/structures/index.js.map +10 -8
- package/dist/structures/interactions.d.ts +72 -17
- package/dist/structures/resources.d.ts +9 -5
- package/dist/types/index.d.ts +530 -85
- package/dist/types/index.js +71 -1
- package/dist/types/index.js.map +3 -3
- package/dist/voice/index.js.map +1 -1
- package/dist/ws/index.js +4 -1
- package/dist/ws/index.js.map +4 -4
- package/package.json +15 -15
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../packages/structures/src/base.ts", "../../packages/structures/src/permissions.ts", "../../packages/structures/src/resources.ts", "../../packages/structures/src/interactions.ts", "../../packages/structures/src/index.ts"],
|
|
3
|
+
"sources": ["../../packages/structures/src/base.ts", "../../packages/structures/src/permissions.ts", "../../packages/structures/src/resources.ts", "../../packages/types/src/index.ts", "../../packages/structures/src/interactions.ts", "../../packages/structures/src/embed.ts", "../../packages/structures/src/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/** Common Discord snowflake-backed structure. */\nexport class BaseStructure {\n /** Discord resource ID. */\n public readonly id: string;\n /** Creates a structure from an ID. @param id Discord snowflake identifier. @throws {TypeError} If the ID is invalid. */\n public constructor(id: string) {\n if (!/^\\d{1,20}$/.test(id))\n throw new TypeError(\"A Discord structure requires a valid snowflake ID.\");\n this.id = id;\n }\n /** Returns the resource ID. @returns Discord snowflake identifier. */\n public toString(): string {\n return this.id;\n }\n}\n\n/** Context used by structures to delegate resource operations to the owning client. */\nexport interface ResourceContext {\n /** Sends a message through the owning channel manager. @param channelId Channel identifier. @param options Message payload. @returns The created message. */\n sendMessage(\n channelId: string,\n options: { content?: string },\n ): Promise<import(\"./index.js\").Message>;\n /** Edits a message through the owning channel manager. @param channelId Channel identifier. @param messageId Message identifier. @param options Edit payload. @returns The updated message. */\n editMessage(\n channelId: string,\n messageId: string,\n options: { content?: string },\n ): Promise<import(\"./index.js\").Message>;\n /** Deletes a message through the owning channel manager. @param channelId Channel identifier. @param messageId Message identifier. @returns A promise fulfilled after deletion. */\n deleteMessage(channelId: string, messageId: string): Promise<void>;\n /** Crossposts a message through the owning channel manager. @param channelId Channel identifier. @param messageId Message identifier. @returns The crossposted message. */\n crosspostMessage(\n channelId: string,\n messageId: string,\n ): Promise<import(\"./index.js\").Message>;\n}\n\n/** Represents a Discord user. */\nexport class User extends BaseStructure {\n /** User name. */ public username: string;\n /** Global display name. */ public globalName: string | null;\n /** Avatar hash. */ public avatar: string | null;\n /** Whether the user is a bot. */ public bot: boolean;\n /** Whether the account is a Discord system user. */ public system: boolean;\n /** Public user flags. */ public flags: number;\n /** Creates a user from Discord API data. @param data User payload. @throws {TypeError} If required data is invalid. */\n public constructor(data: import(\"@lunibee/types\").UserData) {\n super(data.id);\n if (!data.username)\n throw new TypeError(\"A Discord user requires a username.\");\n this.username = data.username;\n this.globalName = data.global_name ?? null;\n this.avatar = data.avatar ?? null;\n this.bot = data.bot ?? false;\n this.system = data.system ?? false;\n this.flags = data.public_flags ?? 0;\n }\n /** Gets the effective display name. @returns Global display name or username. */\n public get displayName(): string {\n return this.globalName ?? this.username;\n }\n /** Creates an avatar CDN URL. @param options URL format options. @returns Avatar URL, or null when no custom avatar exists. */\n public avatarURL(\n options: { extension?: \"png\" | \"jpg\" | \"webp\" | \"gif\"; size?: number } = {},\n ): string | null {\n if (!this.avatar) return null;\n const extension =\n options.extension ?? (this.avatar.startsWith(\"a_\") ? \"gif\" : \"png\");\n return `https://cdn.discordapp.com/avatars/${this.id}/${this.avatar}.${extension}${options.size ? `?size=${options.size}` : \"\"}`;\n }\n /** Creates the default avatar URL. @returns Discord default avatar URL. */\n public defaultAvatarURL(): string {\n return `https://cdn.discordapp.com/embed/avatars/${Number(BigInt(this.id) % 5n)}.png`;\n }\n /** Creates an avatar URL with default fallback. @param options URL format options. @returns Avatar or default avatar URL. */\n public displayAvatarURL(\n options: { extension?: \"png\" | \"jpg\" | \"webp\" | \"gif\"; size?: number } = {},\n ): string {\n return this.avatarURL(options) ?? this.defaultAvatarURL();\n }\n}\n\n/** Represents a Discord channel. */\nexport class Channel extends BaseStructure {\n /** Discord channel type. */ public type: number;\n /** Channel name. */ public name?: string | null;\n /** Guild containing the channel. */ public guildId?: string;\n readonly #context?: ResourceContext;\n /** Creates a channel from Discord API data. @param data Channel payload. @param context Optional owning resource context. @throws {TypeError|RangeError} If required channel data is invalid. */\n public constructor(\n data: import(\"@lunibee/types\").APIChannel,\n context?: ResourceContext,\n ) {\n super(data.id);\n if (!Number.isInteger(data.type) || data.type < 0)\n throw new RangeError(\"A Discord channel requires a valid channel type.\");\n this.type = data.type;\n this.name = data.name;\n this.guildId = data.guild_id;\n this.#context = context;\n }\n /** Sends a message through the owning manager. @param options Message payload. @returns The created message. @throws {Error} If this channel is detached from a client. */\n public sendMessage(options: {\n content?: string;\n }): Promise<import(\"./index.js\").Message> {\n if (!this.#context)\n throw new Error(\"This channel is not attached to a client.\");\n return this.#context.sendMessage(this.id, options);\n }\n}\n\n/** Represents a Discord guild. */\nexport class Guild extends BaseStructure {\n /** Guild name. */ public name: string;\n /** Preferred guild locale. */ public preferredLocale?: string;\n /** Guild owner ID. */ public ownerId?: string;\n /** Creates a guild from Discord API data. @param data Guild payload. @throws {TypeError} If required data is invalid. */\n public constructor(data: {\n id: string;\n name: string;\n preferred_locale?: string;\n owner_id?: string;\n }) {\n super(data.id);\n if (!data.name) throw new TypeError(\"A Discord guild requires a name.\");\n this.name = data.name;\n this.preferredLocale = data.preferred_locale;\n this.ownerId = data.owner_id;\n }\n}\n",
|
|
6
|
-
"/** Permission bit values exposed by Discord. */\
|
|
7
|
-
"import { BaseStructure, Channel, User } from \"./base.js\";\nimport { PermissionsBitField } from \"./permissions.js\";\n\n/** A Discord guild member. */\nexport class GuildMember {\n /** User represented by the member. */ public readonly user: User;\n /** Guild containing the member. */ public readonly guildId: string;\n /** Nickname, if configured. */ public nickname: string | null;\n /** Role IDs assigned to the member. */ public readonly roleIds: string[];\n /** Whether the member is pending membership screening. */ public pending: boolean;\n /** Member join timestamp. */ public joinedAt?: Date;\n /** Raw effective permission bitfield supplied by Discord. */ public readonly permissions: PermissionsBitField;\n /** Creates a guild member from Discord data. @param data Discord guild-member payload. @throws {TypeError} If the guild ID is invalid. @throws {RangeError} If joined_at is invalid. */\n public constructor(data: {\n user: {\n id: string;\n username: string;\n global_name?: string | null;\n avatar?: string | null;\n bot?: boolean;\n system?: boolean;\n public_flags?: number;\n };\n guild_id: string;\n nick?: string | null;\n roles?: string[];\n pending?: boolean;\n joined_at?: string;\n permissions?: string;\n }) {\n this.user = new User(data.user);\n if (!/^\\d{1,20}$/.test(data.guild_id))\n throw new TypeError(\"Member guild_id must be a valid snowflake.\");\n this.guildId = data.guild_id;\n this.nickname = data.nick ?? null;\n this.roleIds = [...(data.roles ?? [])];\n this.pending = data.pending ?? false;\n this.joinedAt = data.joined_at ? new Date(data.joined_at) : undefined;\n if (this.joinedAt?.toString() === \"Invalid Date\")\n throw new RangeError(\"Member joined_at must be a valid date.\");\n this.permissions = new PermissionsBitField(data.permissions ?? 0n);\n }\n /** Effective member display name. @returns Nickname or user display name.
|
|
8
|
-
"/** Discord interaction type constants. */\r\nexport const InteractionType = {\r\n Ping: 1,\r\n ApplicationCommand: 2,\r\n MessageComponent: 3,\r\n ApplicationCommandAutocomplete: 4,\r\n ModalSubmit: 5,\r\n} as const;\r\n/** Discord interaction response type constants. */\r\nexport const InteractionResponseType = {\r\n Pong: 1,\r\n ChannelMessage: 4,\r\n DeferredChannelMessage: 5,\r\n DeferredMessageUpdate: 6,\r\n MessageUpdate: 7,\r\n Autocomplete: 8,\r\n Modal: 9,\r\n} as const;\r\n/** Data shared by Discord interactions. */\r\nexport interface InteractionData {\r\n /** Interaction identifier. */ id: string;\r\n /** Application identifier. */ application_id: string;\r\n /** Interaction type. */ type: number;\r\n /** Interaction token. */ token: string;\r\n /** Gateway/API version. */ version?: number;\r\n /** Guild identifier. */ guild_id?: string;\r\n /** Channel identifier. */ channel_id?: string;\r\n /** Interaction-specific data. */ data?: Record<string, unknown>;\r\n [key: string]: unknown;\r\n}\r\n/** Options for an interaction response message. */\r\nexport interface InteractionReplyOptions {\r\n /** Message content. */ content?: string;\r\n /** Whether the response is ephemeral. */ ephemeral?: boolean;\r\n /** Message components. */ components?: unknown[];\r\n /** Message embeds. */ embeds?: unknown[];\r\n /** Discord message flags. */ flags?: number;\r\n [key: string]: unknown;\r\n}\r\n/** Transport required by an interaction structure. */\r\nexport interface InteractionClient {\r\n /** 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. */ postInteractionResponse(\r\n id: string,\r\n token: string,\r\n response: InteractionResponse,\r\n ): Promise<unknown>;\r\n /** Edits the original interaction response. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */ editInteractionReply(\r\n token: string,\r\n data: InteractionReplyOptions,\r\n ): Promise<unknown>;\r\n /** Deletes the original interaction response. @param token Interaction token. @returns Promise fulfilled after deletion. @throws {Error} When REST fails. */ deleteInteractionReply(\r\n token: string,\r\n ): Promise<void>;\r\n /** Sends a follow-up interaction webhook message. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */ followUpInteraction(\r\n token: string,\r\n data: InteractionReplyOptions,\r\n ): Promise<unknown>;\r\n}\r\n/** A Discord interaction callback payload. */\r\nexport class InteractionResponse {\r\n readonly type: number;\r\n readonly data?: InteractionReplyOptions;\r\n /** Creates a response payload. @param type Discord callback type. @param data Optional callback data. @throws {TypeError} If type is not finite. */\r\n public constructor(type: number, data?: InteractionReplyOptions) {\r\n if (!Number.isFinite(type))\r\n throw new TypeError(\"Interaction response type must be finite.\");\r\n this.type = type;\r\n this.data = data;\r\n }\r\n /** Serializes the response for Discord. @returns Discord callback payload. */ public toJSON(): {\r\n type: number;\r\n data?: InteractionReplyOptions;\r\n } {\r\n return this.data === undefined\r\n ? { type: this.type }\r\n : { type: this.type, data: this.data };\r\n }\r\n /** Creates an immediate message response. @param options Response message options. @returns Callback payload. */ public static message(\r\n options: InteractionReplyOptions,\r\n ): InteractionResponse {\r\n const data: InteractionReplyOptions = { ...options };\r\n if (options.ephemeral) {\r\n data.flags = (typeof options.flags === \"number\" ? options.flags : 0) | 64;\r\n }\r\n return new InteractionResponse(\r\n InteractionResponseType.ChannelMessage,\r\n data,\r\n );\r\n }\r\n /** Creates a deferred channel response. @param ephemeral Whether the eventual response is ephemeral. @returns Callback payload. */ public static defer(\r\n ephemeral = false,\r\n ): InteractionResponse {\r\n return new InteractionResponse(\r\n InteractionResponseType.DeferredChannelMessage,\r\n ephemeral ? { flags: 64 } : undefined,\r\n );\r\n }\r\n /** Creates a Pong response. @returns Callback payload. */ public static pong(): InteractionResponse {\r\n return new InteractionResponse(InteractionResponseType.Pong);\r\n }\r\n}\r\n/** Base interaction structure. */\r\nexport class Interaction<TData extends InteractionData = InteractionData> {\r\n /** Interaction identifier. */ public readonly id: string;\r\n /** Application identifier. */ public readonly applicationId: string;\r\n /** Interaction token. */ public readonly token: string;\r\n /** Guild identifier. */ public readonly guildId?: string;\r\n /** Channel identifier. */ public readonly channelId?: string;\r\n /** Interaction type. */ public readonly type: number;\r\n /** Raw interaction data. */ public readonly data: TData;\r\n /** Whether the initial response was sent. */ public replied = false;\r\n /** Whether the initial response was deferred. */ public deferred = false;\r\n readonly #client: InteractionClient;\r\n /** Creates an interaction from a Gateway payload. @param client Interaction transport. @param data Gateway interaction payload. @throws {TypeError} If required identifiers are missing. */ public constructor(\r\n client: InteractionClient,\r\n data: TData,\r\n ) {\r\n if (!data.id || !data.token)\r\n throw new TypeError(\"Interaction ID and token are required.\");\r\n this.#client = client;\r\n this.id = data.id;\r\n this.applicationId = data.application_id;\r\n this.token = data.token;\r\n this.guildId = data.guild_id;\r\n this.channelId = data.channel_id;\r\n this.type = data.type;\r\n this.data = data;\r\n }\r\n /** Whether this interaction is an application command. @returns True for application command interactions. */ public isChatInputCommand(): this is CommandInteraction {\r\n return this.type === InteractionType.ApplicationCommand;\r\n }\r\n /** Whether this interaction is a message component. @returns True for component interactions. */ public isMessageComponent(): this is ComponentInteraction {\r\n return this.type === InteractionType.MessageComponent;\r\n }\r\n /** Whether this interaction is a modal submission. @returns True for modal submissions. */ public isModalSubmit(): this is ComponentInteraction {\r\n return this.type === InteractionType.ModalSubmit;\r\n }\r\n /** Whether this interaction is autocomplete. @returns True for autocomplete interactions. */ public isAutocomplete(): this is CommandInteraction {\r\n return this.type === InteractionType.ApplicationCommandAutocomplete;\r\n }\r\n /** Ensures the interaction has not already been acknowledged. @returns Nothing. @throws {Error} When already acknowledged. */ protected assertUnacknowledged(): void {\r\n if (this.replied || this.deferred)\r\n throw new Error(\"Interaction has already been acknowledged.\");\r\n }\r\n /** Ensures the interaction has been acknowledged. @returns Nothing. @throws {Error} When not acknowledged. */ protected assertAcknowledged(): void {\r\n if (!this.replied && !this.deferred)\r\n throw new Error(\"Interaction has not been acknowledged.\");\r\n }\r\n /** Posts a raw interaction response callback. */\r\n protected postResponse(response: InteractionResponse): Promise<unknown> {\r\n return this.#client.postInteractionResponse(this.id, this.token, response);\r\n }\r\n /** Sends the initial interaction response. @param options Response message options. @returns Discord response. @throws {Error} When already acknowledged or REST fails. */ public async reply(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n const result = await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n InteractionResponse.message(payload),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n /** Defers the initial interaction response. @param ephemeral Whether the eventual response is ephemeral. @returns Promise fulfilled after acknowledgement. @throws {Error} When already acknowledged or REST fails. */ public async deferReply(\r\n ephemeral = false,\r\n ): Promise<void> {\r\n this.assertUnacknowledged();\r\n await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n InteractionResponse.defer(ephemeral),\r\n );\r\n this.deferred = true;\r\n }\r\n /** Edits the original response. @param options Replacement message options. @returns Discord response. @throws {Error} When not acknowledged or REST fails. */ public editReply(\r\n options: InteractionReplyOptions,\r\n ): Promise<unknown> {\r\n this.assertAcknowledged();\r\n return this.#client.editInteractionReply(this.token, options);\r\n }\r\n /** Deletes the original response. @returns Promise fulfilled after deletion. @throws {Error} When not acknowledged or REST fails. */ public deleteReply(): Promise<void> {\r\n this.assertAcknowledged();\r\n return this.#client.deleteInteractionReply(this.token);\r\n }\r\n /** Sends a follow-up message using the interaction webhook. @param options Follow-up message options. @returns Discord response. @throws {Error} When REST fails. */ public followUp(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n return this.#client.followUpInteraction(this.token, payload);\r\n }\r\n /** Updates the message for a component interaction. */ public async update(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n const result = await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n new InteractionResponse(InteractionResponseType.MessageUpdate, payload),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n /** 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. */\r\n public async showModal(modal: {\r\n custom_id: string;\r\n title: string;\r\n components: unknown[];\r\n [key: string]: unknown;\r\n }): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const result = await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n new InteractionResponse(\r\n InteractionResponseType.Modal,\r\n modal as InteractionReplyOptions,\r\n ),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n}\r\n/** Application command interaction. */\r\nexport class CommandInteraction extends Interaction {\r\n /** Invoked command name. @returns Command name or an empty string. */ public get commandName(): string {\r\n return typeof this.data.data?.name === \"string\" ? this.data.data.name : \"\";\r\n }\r\n}\r\n/** Message component interaction. */\r\nexport class ComponentInteraction extends Interaction {\r\n /** Gets component custom ID. */\r\n public get customId(): string {\r\n return (this.data as any)?.data?.custom_id ?? \"\";\r\n }\r\n /** Gets component type. */\r\n public get componentType(): number {\r\n return (this.data as any)?.data?.component_type ?? 0;\r\n }\r\n /** Gets selected values for select menu component interactions. */\r\n public get values(): string[] {\r\n return (this.data as any)?.data?.values ?? [];\r\n }\r\n /** Defers updating the message to which the component was attached. */\r\n public async deferUpdate(): Promise<void> {\r\n this.assertUnacknowledged();\r\n await this.postResponse(\r\n new InteractionResponse(InteractionResponseType.DeferredMessageUpdate),\r\n );\r\n this.deferred = true;\r\n }\r\n /** Updates the message to which the component was attached. */\r\n public async update(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n const result = await this.postResponse(\r\n new InteractionResponse(InteractionResponseType.MessageUpdate, payload),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n}\r\n\r\n/** Creates a specialized interaction structure for a Gateway payload. @param client Interaction transport. @param data Gateway interaction payload. @returns Specialized interaction structure. @throws {TypeError} If required identifiers are missing. */\r\nexport function createInteraction(\r\n client: InteractionClient,\r\n data: InteractionData,\r\n): Interaction {\r\n switch (data.type) {\r\n case InteractionType.ApplicationCommand:\r\n case InteractionType.ApplicationCommandAutocomplete:\r\n return new CommandInteraction(client, data);\r\n case InteractionType.MessageComponent:\r\n case InteractionType.ModalSubmit:\r\n return new ComponentInteraction(client, data);\r\n default:\r\n return new Interaction(client, data);\r\n }\r\n}\r\n\r\n/** Represents a Discord modal submission interaction. */\r\nexport class ModalSubmitInteraction extends Interaction {\r\n /** Gets the submitted modal custom ID. */\r\n public get customId(): string {\r\n return (this.data as any)?.data?.custom_id ?? \"\";\r\n }\r\n\r\n /** Retrieves the text value for a specific text input custom ID. */\r\n public getInputValue(customId: string): string | undefined {\r\n const rows = (this.data as any)?.data?.components ?? [];\r\n for (const row of rows) {\r\n for (const comp of row.components ?? []) {\r\n if (comp.custom_id === customId) return comp.value;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/** Represents a Discord slash command autocomplete interaction. */\r\nexport class AutocompleteInteraction extends Interaction {\r\n /** Gets the target command name. */\r\n public get commandName(): string {\r\n return (this.data as any)?.data?.name ?? \"\";\r\n }\r\n\r\n /** Gets the currently focused autocomplete option. */\r\n public get focusedOption(): { name: string; value: unknown } | undefined {\r\n const options = (this.data as any)?.data?.options ?? [];\r\n return options.find((opt: any) => opt.focused);\r\n }\r\n\r\n /** Responds to Discord with autocomplete choices. */\r\n public async respond(\r\n choices: { name: string; value: string | number }[],\r\n ): Promise<void> {\r\n const response = new InteractionResponse(\r\n InteractionResponseType.Autocomplete,\r\n { choices },\r\n );\r\n await this.postResponse(response);\r\n }\r\n}\r\n",
|
|
9
|
-
"import { BaseStructure, Channel, User } from \"./base.js\";\nimport type { ResourceContext } from \"./base.js\";\n\n/** Common Discord structure exports. */\nexport { BaseStructure, Channel, Guild, User } from \"./base.js\";\nexport type { ResourceContext } from \"./base.js\";\n\n/** Represents a Discord message. */\nexport class Message extends BaseStructure {\n /** Message content. */ public content: string;\n /** Message author. */ public author: User;\n /** Channel ID containing the message. */ public channelId: string;\n /** Channel containing the message. */ public readonly channel: Channel;\n /** Guild ID containing the message. */ public guildId?: string;\n /** Message flags. */ public flags: number;\n /** Message creation time. */ public readonly createdAt: Date;\n /** Message attachments. */ public readonly attachments: import(\"@lunibee/types\").APIAttachment[];\n /** Message embeds. */ public readonly embeds: import(\"@lunibee/types\").APIEmbed[];\n /** Mentioned users. */ public readonly mentions: User[];\n /** Mentioned role IDs. */ public readonly mentionRoles: string[];\n /** Whether the message is pinned. */ public pinned: boolean;\n /** Whether the message mentions everyone. */ public mentionEveryone: boolean;\n /** Discord message type. */ public type: number;\n /** Message reference (reply chain data). */ public readonly reference?: import(\"@lunibee/types\").APIMessageReference;\n /** The referenced/replied-to message, if included by Discord. */ public readonly referencedMessage?: Message | null;\n readonly #context?: ResourceContext;\n /** Creates a message from Discord API data. @param data Message payload. @param context Optional owning resource context. @throws {TypeError} If required message identifiers are invalid. */\n public constructor(\n data: import(\"@lunibee/types\").APIMessage,\n context?: ResourceContext,\n ) {\n super(data.id);\n if (!/^\\d{1,20}$/.test(data.channel_id))\n throw new TypeError(\"Message channel_id must be a valid snowflake.\");\n this.content = data.content ?? \"\";\n this.author = new User(data.author);\n this.channelId = data.channel_id;\n this.guildId = data.guild_id;\n this.flags = data.flags ?? 0;\n this.createdAt = new Date(\n data.timestamp ?? Number((BigInt(this.id) >> 22n) + 1420070400000n),\n );\n this.attachments = data.attachments ?? [];\n this.embeds = data.embeds ?? [];\n this.mentions = (data.mentions ?? []).map((user) => new User(user));\n this.mentionRoles = data.mention_roles ?? [];\n this.pinned = data.pinned ?? false;\n this.mentionEveryone = data.mention_everyone ?? false;\n this.type = data.type ?? 0;\n this.reference = data.message_reference;\n this.referencedMessage = data.referenced_message\n ? new Message(data.referenced_message, context)\n : data.referenced_message === null\n ? null\n : undefined;\n this.#context = context;\n this.channel = new Channel(\n { id: data.channel_id, type: 0, guild_id: data.guild_id },\n context,\n );\n }\n /** Whether embeds are suppressed. @returns True when the suppress-embeds flag is set. */ public get embedsSuppressed(): boolean {\n return (this.flags & 4) !== 0;\n }\n /** Edits this message. @param options Edit payload. @returns Updated message. @throws {Error} If detached from a client. */ public edit(options: {\n content?: string;\n }): Promise<Message> {\n if (!this.#context)\n throw new Error(\"This message is not attached to a client.\");\n return this.#context.editMessage(this.channelId, this.id, options);\n }\n /** Deletes this message. @returns Nothing. @throws {Error} If detached from a client. */ public delete(): Promise<void> {\n if (!this.#context)\n throw new Error(\"This message is not attached to a client.\");\n return this.#context.deleteMessage(this.channelId, this.id);\n }\n /** Crossposts this message. @returns Crossposted message. @throws {Error} If detached from a client. */ public crosspost(): Promise<Message> {\n if (!this.#context)\n throw new Error(\"This message is not attached to a client.\");\n return this.#context.crosspostMessage(this.channelId, this.id);\n }\n /** Replies in this message's channel, auto-populating message_reference. @param options Message content or payload. @returns Created reply. @throws {Error} If detached from a client. */ public reply(\n options: string | { content?: string; [key: string]: unknown },\n ): Promise<Message> {\n if (!this.#context)\n throw new Error(\"This message is not attached to a client.\");\n const payload =\n typeof options === \"string\" ? { content: options } : { ...options };\n // Automatically thread the reply via Discord's message_reference\n (payload as Record<string, unknown>).message_reference = {\n message_id: this.id,\n channel_id: this.channelId,\n guild_id: this.guildId,\n };\n return this.#context.sendMessage(this.channelId, payload);\n }\n}\n\nexport { GuildMember, Role, TextChannel } from \"./resources.js\";\nexport * from \"./interactions.js\";\n"
|
|
5
|
+
"/** Common Discord snowflake-backed structure. */\r\nexport class BaseStructure {\r\n public readonly id: string;\r\n public constructor(id: string) {\r\n if (!/^\\d{1,20}$/.test(id))\r\n throw new TypeError(\"A Discord structure requires a valid snowflake ID.\");\r\n this.id = id;\r\n }\r\n /** Returns the snowflake ID as a string. */\r\n public toString(): string {\r\n return this.id;\r\n }\r\n /** Returns the timestamp this snowflake was created at. */\r\n public get createdAt(): Date {\r\n return new Date(Number((BigInt(this.id) >> 22n) + 1420070400000n));\r\n }\r\n}\r\n\r\nexport interface ResourceContext {\r\n sendMessage(\r\n channelId: string,\r\n options: Record<string, unknown> & { content?: string },\r\n ): Promise<import(\"./index.js\").Message>;\r\n editMessage(\r\n channelId: string,\r\n messageId: string,\r\n options: Record<string, unknown> & { content?: string },\r\n ): Promise<import(\"./index.js\").Message>;\r\n deleteMessage(channelId: string, messageId: string): Promise<void>;\r\n crosspostMessage(\r\n channelId: string,\r\n messageId: string,\r\n ): Promise<import(\"./index.js\").Message>;\r\n editChannel?(\r\n channelId: string,\r\n options: Record<string, unknown>,\r\n ): Promise<import(\"./base.js\").Channel>;\r\n deleteChannel?(channelId: string): Promise<void>;\r\n addReaction?(\r\n channelId: string,\r\n messageId: string,\r\n emoji: string,\r\n ): Promise<void>;\r\n removeOwnReaction?(\r\n channelId: string,\r\n messageId: string,\r\n emoji: string,\r\n ): Promise<void>;\r\n removeReaction?(\r\n channelId: string,\r\n messageId: string,\r\n emoji: string,\r\n userId: string,\r\n ): Promise<void>;\r\n removeAllReactions?(channelId: string, messageId: string): Promise<void>;\r\n pinMessage?(channelId: string, messageId: string): Promise<void>;\r\n unpinMessage?(channelId: string, messageId: string): Promise<void>;\r\n}\r\n\r\n// ─── CDN helpers ──────────────────────────────────────────────────────────────\r\n\r\nconst CDN_BASE = \"https://cdn.discordapp.com\";\r\n\r\n/** Options for CDN image URLs. */\r\nexport interface ImageURLOptions {\r\n extension?: \"png\" | \"jpg\" | \"webp\" | \"gif\" | \"jpeg\";\r\n size?: 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;\r\n forceStatic?: boolean;\r\n}\r\n\r\nfunction cdnURL(\r\n path: string,\r\n hash: string,\r\n options: ImageURLOptions = {},\r\n): string {\r\n const isAnimated = hash.startsWith(\"a_\") && !options.forceStatic;\r\n const ext = options.extension ?? (isAnimated ? \"gif\" : \"png\");\r\n const size = options.size ? `?size=${options.size}` : \"\";\r\n return `${CDN_BASE}${path}/${hash}.${ext}${size}`;\r\n}\r\n\r\n// ─── User ─────────────────────────────────────────────────────────────────────\r\n\r\nexport class User extends BaseStructure {\r\n public username: string;\r\n public globalName: string | null;\r\n public avatar: string | null;\r\n public bot: boolean;\r\n public system: boolean;\r\n public flags: number;\r\n public discriminator: string | null;\r\n public constructor(data: import(\"@lunibee/types\").UserData) {\r\n super(data.id);\r\n if (!data.username)\r\n throw new TypeError(\"A Discord user requires a username.\");\r\n this.username = data.username;\r\n this.globalName = data.global_name ?? null;\r\n this.avatar = data.avatar ?? null;\r\n this.bot = data.bot ?? false;\r\n this.system = data.system ?? false;\r\n this.flags = data.public_flags ?? 0;\r\n this.discriminator = data.discriminator && data.discriminator !== \"0\" ? data.discriminator : null;\r\n }\r\n /** Effective display name — global name, falling back to username. */\r\n public get displayName(): string {\r\n return this.globalName ?? this.username;\r\n }\r\n /** Returns the user's avatar URL, or null if they have no avatar. */\r\n public avatarURL(options: ImageURLOptions = {}): string | null {\r\n if (!this.avatar) return null;\r\n return cdnURL(`/avatars/${this.id}`, this.avatar, options);\r\n }\r\n /** Returns the default avatar URL based on the user's discriminator/snowflake. */\r\n public defaultAvatarURL(): string {\r\n const index = this.discriminator\r\n ? Number(this.discriminator) % 5\r\n : Number((BigInt(this.id) >> 22n) % 6n);\r\n return `${CDN_BASE}/embed/avatars/${index}.png`;\r\n }\r\n /** Returns the avatar URL if available, falling back to the default avatar URL. */\r\n public displayAvatarURL(options: ImageURLOptions = {}): string {\r\n return this.avatarURL(options) ?? this.defaultAvatarURL();\r\n }\r\n /** Returns the Discord mention string. Used automatically in template literals. */\r\n public override toString(): string {\r\n return `<@${this.id}>`;\r\n }\r\n}\r\n\r\n// ─── Channel ──────────────────────────────────────────────────────────────────\r\n\r\nexport class Channel extends BaseStructure {\r\n public type: number;\r\n public name?: string | null;\r\n public guildId?: string;\r\n public topic?: string | null;\r\n public parentId?: string | null;\r\n public nsfw?: boolean;\r\n public rateLimitPerUser?: number;\r\n public position?: number;\r\n readonly #context?: ResourceContext;\r\n\r\n /** Creates a channel structure from Discord channel data. */\r\n public constructor(\r\n data: import(\"@lunibee/types\").APIChannel,\r\n context?: ResourceContext,\r\n ) {\r\n super(data.id);\r\n if (!Number.isInteger(data.type) || data.type < 0)\r\n throw new RangeError(\"A Discord channel requires a valid channel type.\");\r\n this.type = data.type;\r\n this.name = data.name;\r\n this.guildId = data.guild_id;\r\n this.topic = data.topic;\r\n this.parentId = data.parent_id;\r\n this.nsfw = data.nsfw;\r\n this.rateLimitPerUser = data.rate_limit_per_user;\r\n this.position = data.position;\r\n this.#context = context;\r\n }\r\n\r\n /** Sends a message to this channel. @param options Message payload. @returns The created message. @throws {Error} If the channel is not attached to a client. */\r\n public sendMessage(\r\n options: Record<string, unknown> & { content?: string },\r\n ): Promise<import(\"./index.js\").Message> {\r\n if (!this.#context)\r\n throw new Error(\"This channel is not attached to a client.\");\r\n return this.#context.sendMessage(this.id, options);\r\n }\r\n\r\n /** Sends a message using Lunibee's concise channel API. @param options Message payload. @returns The created message. @throws {Error} If the channel is not attached to a client. */\r\n public send(\r\n options: Record<string, unknown> & { content?: string },\r\n ): Promise<import(\"./index.js\").Message> {\r\n return this.sendMessage(options);\r\n }\r\n\r\n /** Edits this channel. @param options Channel fields to change. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */\r\n public edit(options: Record<string, unknown>): Promise<Channel> {\r\n if (!this.#context?.editChannel)\r\n throw new Error(\"This channel is not attached to a client.\");\r\n return this.#context.editChannel(this.id, options);\r\n }\r\n\r\n /** Changes only this channel's name. @param name New channel name. @returns The updated channel. @throws {TypeError} If the name is empty. @throws {Error} If the channel is not attached to a client. */\r\n public editName(name: string): Promise<Channel> {\r\n if (!name.trim()) throw new TypeError(\"Channel name cannot be empty.\");\r\n return this.edit({ name });\r\n }\r\n\r\n /** Changes only this channel's topic. @param topic New topic, or null to clear it. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */\r\n public editTopic(topic: string | null): Promise<Channel> {\r\n return this.edit({ topic });\r\n }\r\n\r\n /** Moves this channel to another parent category. @param parentId Parent category ID, or null to remove the parent. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */\r\n public editParent(parentId: string | null): Promise<Channel> {\r\n return this.edit({ parent_id: parentId });\r\n }\r\n\r\n /** Deletes this channel. @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the channel is not attached to a client. */\r\n public delete(): Promise<void> {\r\n if (!this.#context?.deleteChannel)\r\n throw new Error(\"This channel is not attached to a client.\");\r\n return this.#context.deleteChannel(this.id);\r\n }\r\n\r\n /** Updates this channel using the same resource operation as edit. @param options Channel fields to change. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */\r\n public update(options: Record<string, unknown>): Promise<Channel> {\r\n return this.edit(options);\r\n }\r\n\r\n /** Returns the Discord channel mention string. Used automatically in template literals. */\r\n public override toString(): string {\r\n return `<#${this.id}>`;\r\n }\r\n}\r\n\r\n// ─── Guild ────────────────────────────────────────────────────────────────────\r\n\r\nexport class Guild extends BaseStructure {\r\n public name: string;\r\n public icon: string | null;\r\n public splash: string | null;\r\n public banner: string | null;\r\n public description: string | null;\r\n public preferredLocale: string;\r\n public ownerId?: string;\r\n public features: string[];\r\n public verificationLevel: number;\r\n public premiumTier: number;\r\n public premiumSubscriptionCount: number;\r\n public memberCount?: number;\r\n public approximateMemberCount?: number;\r\n public approximatePresenceCount?: number;\r\n public vanityUrlCode: string | null;\r\n public nsfwLevel: number;\r\n public discoverySplash: string | null;\r\n\r\n public constructor(data: import(\"@lunibee/types\").APIGuild) {\r\n super(data.id);\r\n if (!data.name) throw new TypeError(\"A Discord guild requires a name.\");\r\n this.name = data.name;\r\n this.icon = data.icon ?? null;\r\n this.splash = data.splash ?? null;\r\n this.banner = data.banner ?? null;\r\n this.description = data.description ?? null;\r\n this.preferredLocale = data.preferred_locale ?? \"en-US\";\r\n this.ownerId = data.owner_id;\r\n this.features = data.features ?? [];\r\n this.verificationLevel = data.verification_level ?? 0;\r\n this.premiumTier = data.premium_tier ?? 0;\r\n this.premiumSubscriptionCount = data.premium_subscription_count ?? 0;\r\n this.memberCount = data.member_count ?? data.approximate_member_count;\r\n this.approximateMemberCount = data.approximate_member_count;\r\n this.approximatePresenceCount = data.approximate_presence_count;\r\n this.vanityUrlCode = data.vanity_url_code ?? null;\r\n this.nsfwLevel = data.nsfw_level ?? 0;\r\n this.discoverySplash = data.discovery_splash ?? null;\r\n }\r\n\r\n /** Returns the guild icon URL, or null if no icon is set. */\r\n public iconURL(options: ImageURLOptions = {}): string | null {\r\n if (!this.icon) return null;\r\n return cdnURL(`/icons/${this.id}`, this.icon, options);\r\n }\r\n\r\n /** Returns the guild splash URL, or null if none. */\r\n public splashURL(options: ImageURLOptions = {}): string | null {\r\n if (!this.splash) return null;\r\n return cdnURL(`/splashes/${this.id}`, this.splash, options);\r\n }\r\n\r\n /** Returns the guild banner URL, or null if none. */\r\n public bannerURL(options: ImageURLOptions = {}): string | null {\r\n if (!this.banner) return null;\r\n return cdnURL(`/banners/${this.id}`, this.banner, options);\r\n }\r\n\r\n /** Returns the guild discovery splash URL, or null if none. */\r\n public discoverySplashURL(\r\n options: ImageURLOptions = {},\r\n ): string | null {\r\n if (!this.discoverySplash) return null;\r\n return cdnURL(`/discovery-splashes/${this.id}`, this.discoverySplash, options);\r\n }\r\n\r\n /** Whether the guild has a given feature flag. @param feature Feature string, e.g. \"COMMUNITY\". */\r\n public hasFeature(feature: string): boolean {\r\n return this.features.includes(feature);\r\n }\r\n\r\n /** Whether the guild is a Community server. */\r\n public get isCommunity(): boolean {\r\n return this.hasFeature(\"COMMUNITY\");\r\n }\r\n\r\n /** Whether the guild has a vanity URL. */\r\n public get hasVanityUrl(): boolean {\r\n return this.vanityUrlCode !== null;\r\n }\r\n\r\n /** Returns the guild's vanity invite URL, or null if none. */\r\n public get vanityURL(): string | null {\r\n return this.vanityUrlCode\r\n ? `https://discord.gg/${this.vanityUrlCode}`\r\n : null;\r\n }\r\n\r\n /** Returns a human-readable string representation. */\r\n public override toString(): string {\r\n return this.name;\r\n }\r\n}\r\n",
|
|
6
|
+
"/** Permission bit values exposed by Discord. */\nexport const Permissions = {\n /** Create instant invite permission. */ CreateInstantInvite: 1n << 0n,\n /** Kick members permission. */ KickMembers: 1n << 1n,\n /** Ban members permission. */ BanMembers: 1n << 2n,\n /** Administrator permission. */ Administrator: 1n << 3n,\n /** Manage channels permission. */ ManageChannels: 1n << 4n,\n /** Manage guild permission. */ ManageGuild: 1n << 5n,\n /** Add reactions permission. */ AddReactions: 1n << 6n,\n /** View audit log permission. */ ViewAuditLog: 1n << 7n,\n /** Priority speaker permission. */ PrioritySpeaker: 1n << 8n,\n /** Stream permission. */ Stream: 1n << 9n,\n /** View channel permission. */ ViewChannel: 1n << 10n,\n /** Send messages permission. */ SendMessages: 1n << 11n,\n /** Send TTS messages permission. */ SendTTSMessages: 1n << 12n,\n /** Manage messages permission. */ ManageMessages: 1n << 13n,\n /** Embed links permission. */ EmbedLinks: 1n << 14n,\n /** Attach files permission. */ AttachFiles: 1n << 15n,\n /** Read message history permission. */ ReadMessageHistory: 1n << 16n,\n /** Mention everyone permission. */ MentionEveryone: 1n << 17n,\n /** Use external emojis permission. */ UseExternalEmojis: 1n << 18n,\n /** View guild insights permission. */ ViewGuildInsights: 1n << 19n,\n /** Connect permission. */ Connect: 1n << 20n,\n /** Speak permission. */ Speak: 1n << 21n,\n /** Mute members permission. */ MuteMembers: 1n << 22n,\n /** Deafen members permission. */ DeafenMembers: 1n << 23n,\n /** Move members permission. */ MoveMembers: 1n << 24n,\n /** Use voice activity detection permission. */ UseVAD: 1n << 25n,\n /** Change nickname permission. */ ChangeNickname: 1n << 26n,\n /** Manage nicknames permission. */ ManageNicknames: 1n << 27n,\n /** Manage roles permission. */ ManageRoles: 1n << 28n,\n /** Manage webhooks permission. */ ManageWebhooks: 1n << 29n,\n /** Manage guild expressions permission. */ ManageGuildExpressions: 1n << 30n,\n /** Use application commands permission. */ UseApplicationCommands: 1n << 31n,\n /** Request to speak permission. */ RequestToSpeak: 1n << 32n,\n /** Manage events permission. */ ManageEvents: 1n << 33n,\n /** Manage threads permission. */ ManageThreads: 1n << 34n,\n /** Create public threads permission. */ CreatePublicThreads: 1n << 35n,\n /** Create private threads permission. */ CreatePrivateThreads: 1n << 36n,\n /** Use external stickers permission. */ UseExternalStickers: 1n << 37n,\n /** Send messages in threads permission. */ SendMessagesInThreads: 1n << 38n,\n /** Use embedded activities permission. */ UseEmbeddedActivities: 1n << 39n,\n /** Moderate members permission. */ ModerateMembers: 1n << 40n,\n /** View creator monetization analytics permission. */ ViewCreatorMonetizationAnalytics:\n 1n << 41n,\n /** Use soundboard permission. */ UseSoundboard: 1n << 42n,\n /** Create guild expressions permission. */ CreateGuildExpressions: 1n << 43n,\n /** Create events permission. */ CreateEvents: 1n << 44n,\n /** Use external sounds permission. */ UseExternalSounds: 1n << 45n,\n /** Send voice messages permission. */ SendVoiceMessages: 1n << 46n,\n /** Send polls permission. */ SendPolls: 1n << 49n,\n /** Use external apps permission. */ UseExternalApps: 1n << 50n,\n} as const;\n\n/** Public permission resolvable. */\nexport type PermissionResolvable =\n | bigint\n | number\n | string\n | PermissionName\n | PermissionSet\n | PermissionResolvable[];\n\n/** Immutable Discord permission bitfield. */\nexport class PermissionSet {\n /** Permission bitfield. */ public readonly bitfield: bigint;\n /** Creates a permission set. @param value Initial permission bitfield. @throws {RangeError} If the value is negative. @throws {TypeError} If the value is not a valid integer. */\n public constructor(value: PermissionResolvable = 0n) {\n try {\n if (Array.isArray(value)) {\n let bit = 0n;\n for (const item of value) bit |= this.#resolve(item);\n this.bitfield = bit;\n } else if (value instanceof PermissionSet) {\n this.bitfield = value.bitfield;\n } else {\n const bitfield = this.#resolve(value);\n if (bitfield < 0n)\n throw new RangeError(\"Permission bitfield cannot be negative.\");\n this.bitfield = bitfield;\n }\n } catch (error) {\n if (error instanceof RangeError) throw error;\n throw new TypeError(\n \"Permission bitfield must be a valid non-negative integer.\",\n { cause: error },\n );\n }\n }\n /** Checks whether all supplied permissions are present. @param permissions Permission names or raw bits. @returns True when every requested permission is present. */ public has(\n ...permissions: PermissionResolvable[]\n ): boolean {\n return permissions.every(\n (permission) =>\n (this.bitfield & this.#resolve(permission)) ===\n this.#resolve(permission),\n );\n }\n /** Checks whether any supplied permission is present. @param permissions Permission names or raw bits. @returns True when at least one requested permission is present. */ public any(\n ...permissions: PermissionResolvable[]\n ): boolean {\n return permissions.some(\n (permission) => (this.bitfield & this.#resolve(permission)) !== 0n,\n );\n }\n /** Returns a new set with permissions added. @param permissions Permission names or raw bits. @returns A new permission set. */ public add(\n ...permissions: PermissionResolvable[]\n ): PermissionSet {\n let bitfield = this.bitfield;\n for (const permission of permissions) bitfield |= this.#resolve(permission);\n return new PermissionSet(bitfield);\n }\n /** Returns a new set with permissions removed. @param permissions Permission names or raw bits. @returns A new permission set. */ public remove(\n ...permissions: PermissionResolvable[]\n ): PermissionSet {\n let bitfield = this.bitfield;\n for (const permission of permissions)\n bitfield &= ~this.#resolve(permission);\n return new PermissionSet(bitfield);\n }\n /** Checks equality with another permission set or raw bitfield. @param other Permission set or raw bitfield. @returns True when both values are equal. */ public equals(\n other: PermissionSet | bigint | number | string,\n ): boolean {\n return (\n this.bitfield ===\n (other instanceof PermissionSet\n ? other.bitfield\n : new PermissionSet(other).bitfield)\n );\n }\n /** Returns the decimal permission representation. @returns Decimal permission bitfield. */ public toString(): string {\n return this.bitfield.toString();\n }\n /** Returns known permission names contained in this set. @returns Names of all enabled known permissions. */ public toArray(): PermissionName[] {\n return (Object.keys(Permissions) as PermissionName[]).filter((permission) =>\n this.has(permission),\n );\n }\n /** Resolves a named permission or raw bit. @param permission Permission name or raw bit. @returns Numeric permission bit. */ #resolve(\n permission: PermissionResolvable,\n ): bigint {\n if (permission instanceof PermissionSet) return permission.bitfield;\n if (typeof permission === \"bigint\") return permission;\n if (typeof permission === \"number\") return BigInt(permission);\n if (Array.isArray(permission)) {\n let bit = 0n;\n for (const p of permission) bit |= this.#resolve(p);\n return bit;\n }\n if (typeof permission === \"string\") {\n if (permission in Permissions)\n return (Permissions as Record<string, bigint>)[permission]!;\n const matchedKey = Object.keys(Permissions).find(\n (k) => k.toLowerCase() === permission.toLowerCase(),\n );\n if (matchedKey)\n return (Permissions as Record<string, bigint>)[matchedKey]!;\n return BigInt(permission);\n }\n return 0n;\n }\n}\n\n/** Discord.js-compatible permission bitfield. */\nexport class PermissionsBitField extends PermissionSet {\n /** Creates a permissions bitfield. @param value Initial permission bitfield. */\n public constructor(value: PermissionResolvable = 0n) {\n super(value);\n }\n}\n",
|
|
7
|
+
"import { BaseStructure, Channel, User } from \"./base.js\";\r\nimport { PermissionsBitField } from \"./permissions.js\";\r\n\r\n/** A Discord guild member. */\r\nexport class GuildMember {\r\n /** User represented by the member. */ public readonly user: User;\r\n /** Guild containing the member. */ public readonly guildId: string;\r\n /** Nickname, if configured. */ public nickname: string | null;\r\n /** Role IDs assigned to the member. */ public readonly roleIds: string[];\r\n /** Whether the member is pending membership screening. */ public pending: boolean;\r\n /** Member join timestamp. */ public joinedAt?: Date;\r\n /** Raw effective permission bitfield supplied by Discord. */ public readonly permissions: PermissionsBitField;\r\n /** Creates a guild member from Discord data. @param data Discord guild-member payload. @throws {TypeError} If the guild ID is invalid. @throws {RangeError} If joined_at is invalid. */\r\n public constructor(data: {\r\n user: {\r\n id: string;\r\n username: string;\r\n global_name?: string | null;\r\n avatar?: string | null;\r\n bot?: boolean;\r\n system?: boolean;\r\n public_flags?: number;\r\n };\r\n guild_id: string;\r\n nick?: string | null;\r\n roles?: string[];\r\n pending?: boolean;\r\n joined_at?: string;\r\n permissions?: string;\r\n }) {\r\n this.user = new User(data.user);\r\n if (!/^\\d{1,20}$/.test(data.guild_id))\r\n throw new TypeError(\"Member guild_id must be a valid snowflake.\");\r\n this.guildId = data.guild_id;\r\n this.nickname = data.nick ?? null;\r\n this.roleIds = [...(data.roles ?? [])];\r\n this.pending = data.pending ?? false;\r\n this.joinedAt = data.joined_at ? new Date(data.joined_at) : undefined;\r\n if (this.joinedAt?.toString() === \"Invalid Date\")\r\n throw new RangeError(\"Member joined_at must be a valid date.\");\r\n this.permissions = new PermissionsBitField(data.permissions ?? 0n);\r\n }\r\n /** Effective member display name. @returns Nickname or user display name. */\r\n public get displayName(): string {\r\n return this.nickname ?? this.user.displayName;\r\n }\r\n /** Returns the Discord user mention for this member. */\r\n public toString(): string {\r\n return this.user.toString();\r\n }\r\n}\r\n\r\n/** A Discord guild role. */\r\nexport class Role extends BaseStructure {\r\n /** Role name. */ public name: string;\r\n /** Role color. */ public color: number;\r\n /** Whether the role is hoisted. */ public hoist: boolean;\r\n /** Permission bitfield. */ public permissions: PermissionsBitField;\r\n /** Whether the role is managed. */ public managed: boolean;\r\n /** Whether the role is mentionable. */ public mentionable: boolean;\r\n /** Creates a role from Discord data. @param data Discord role payload. */\r\n public constructor(data: {\r\n id: string;\r\n name: string;\r\n color?: number;\r\n hoist?: boolean;\r\n permissions?: string;\r\n managed?: boolean;\r\n mentionable?: boolean;\r\n }) {\r\n super(data.id);\r\n if (!data.name) throw new TypeError(\"Role name cannot be empty.\");\r\n this.name = data.name;\r\n this.color = data.color ?? 0;\r\n this.hoist = data.hoist ?? false;\r\n this.permissions = new PermissionsBitField(data.permissions ?? 0n);\r\n this.managed = data.managed ?? false;\r\n this.mentionable = data.mentionable ?? false;\r\n }\r\n /** Discord role mention string. Used automatically in template literals. */\r\n public override toString(): string {\r\n return `<@&${this.id}>`;\r\n }\r\n}\r\n\r\n/** A Discord text-capable channel. */\r\nexport class TextChannel extends Channel {\r\n /** Creates a text channel from Discord data. @param data Discord channel payload. */\r\n public constructor(\r\n data: {\r\n id: string;\r\n type: number;\r\n name?: string;\r\n parent_id?: string | null;\r\n guild_id?: string;\r\n },\r\n context?: import(\"./base.js\").ResourceContext,\r\n ) {\r\n super(data, context);\r\n }\r\n /** Discord channel mention string. Used automatically in template literals. */\r\n public override toString(): string {\r\n return `<#${this.id}>`;\r\n }\r\n}\r\n",
|
|
8
|
+
"/** Discord API snowflake identifier. */\r\nexport type Snowflake = string;\r\n\r\n// ─── Gateway Intents ─────────────────────────────────────────────────────────\r\n\r\n/** Gateway intent bit flags supported by Discord (PascalCase). */\r\nexport const GatewayIntentBits = {\r\n Guilds: 1 << 0,\r\n GuildMembers: 1 << 1,\r\n GuildModeration: 1 << 2,\r\n GuildExpressions: 1 << 3,\r\n GuildIntegrations: 1 << 4,\r\n GuildWebhooks: 1 << 5,\r\n GuildInvites: 1 << 6,\r\n GuildVoiceStates: 1 << 7,\r\n GuildPresences: 1 << 8,\r\n GuildMessages: 1 << 9,\r\n GuildMessageReactions: 1 << 10,\r\n GuildMessageTyping: 1 << 11,\r\n DirectMessages: 1 << 12,\r\n DirectMessageReactions: 1 << 13,\r\n DirectMessageTyping: 1 << 14,\r\n MessageContent: 1 << 15,\r\n GuildScheduledEvents: 1 << 16,\r\n AutoModerationConfiguration: 1 << 20,\r\n AutoModerationExecution: 1 << 21,\r\n GuildMessagePolls: 1 << 24,\r\n DirectMessagePolls: 1 << 25,\r\n} as const;\r\n\r\n/** Idiomatic camelCase Gateway intent bit flags supported by Discord. */\r\nexport const IntentBits = {\r\n guild: 1 << 0,\r\n guilds: 1 << 0,\r\n guildMembers: 1 << 1,\r\n guildModeration: 1 << 2,\r\n guildBans: 1 << 2,\r\n guildExpressions: 1 << 3,\r\n guildEmojis: 1 << 3,\r\n guildEmojisAndStickers: 1 << 3,\r\n guildIntegrations: 1 << 4,\r\n guildWebhooks: 1 << 5,\r\n guildInvites: 1 << 6,\r\n guildVoiceStates: 1 << 7,\r\n guildPresences: 1 << 8,\r\n guildMessages: 1 << 9,\r\n guildMessage: 1 << 9,\r\n guildMessageReactions: 1 << 10,\r\n guildMessageTyping: 1 << 11,\r\n directMessages: 1 << 12,\r\n directMessageReactions: 1 << 13,\r\n directMessageTyping: 1 << 14,\r\n messageContent: 1 << 15,\r\n guildScheduledEvents: 1 << 16,\r\n autoModerationConfiguration: 1 << 20,\r\n autoModerationExecution: 1 << 21,\r\n guildMessagePolls: 1 << 24,\r\n directMessagePolls: 1 << 25,\r\n} as const;\r\n\r\n/** Alias for IntentBits. */\r\nexport const Intents = IntentBits;\r\n\r\n/** Gateway intent resolvable value (single bitfield, enum key, or array of bitfields/strings). */\r\nexport type GatewayIntentResolvable =\r\n | number\r\n | keyof typeof GatewayIntentBits\r\n | keyof typeof IntentBits\r\n | (\r\n number | keyof typeof GatewayIntentBits | keyof typeof IntentBits | string\r\n )[];\r\n\r\n/** Resolves any GatewayIntentResolvable into a raw bitfield integer. */\r\nexport function resolveGatewayIntents(\r\n intents: GatewayIntentResolvable,\r\n): number {\r\n if (typeof intents === \"number\") return intents;\r\n if (Array.isArray(intents)) {\r\n return intents.reduce<number>((acc, intent) => {\r\n return acc | resolveGatewayIntents(intent as any);\r\n }, 0);\r\n }\r\n if (typeof intents === \"string\") {\r\n if (intents in GatewayIntentBits)\r\n return (GatewayIntentBits as Record<string, number>)[intents]!;\r\n if (intents in IntentBits)\r\n return (IntentBits as Record<string, number>)[intents]!;\r\n const lower = intents.charAt(0).toLowerCase() + intents.slice(1);\r\n if (lower in IntentBits)\r\n return (IntentBits as Record<string, number>)[lower]!;\r\n const num = Number(intents);\r\n if (!Number.isNaN(num)) return num;\r\n }\r\n return 0;\r\n}\r\n\r\n// ─── Gateway Config ───────────────────────────────────────────────────────────\r\n\r\n/** Gateway connection properties (OS, browser, device). */\r\nexport interface GatewayProperties {\r\n os?: string;\r\n browser?: string;\r\n device?: string;\r\n [key: string]: unknown;\r\n}\r\n/** Gateway presence activity. */\r\nexport interface GatewayPresenceActivity {\r\n name: string;\r\n type?: number;\r\n url?: string;\r\n state?: string;\r\n}\r\n/** Gateway presence data. */\r\nexport interface GatewayPresence {\r\n status?: \"online\" | \"dnd\" | \"idle\" | \"invisible\" | \"offline\";\r\n activities?: GatewayPresenceActivity[];\r\n afk?: boolean;\r\n since?: number | null;\r\n}\r\n/** Client configuration. */\r\nexport interface ClientOptions {\r\n token: string;\r\n intents: GatewayIntentResolvable;\r\n gateway?: GatewayOptions;\r\n rest?: RESTOptions;\r\n}\r\n/** Gateway connection configuration. */\r\nexport interface GatewayOptions {\r\n intents?: GatewayIntentResolvable;\r\n reconnect?: boolean;\r\n maxReconnectAttempts?: number;\r\n reconnectBaseDelay?: number;\r\n reconnectMaxDelay?: number;\r\n shardId?: number;\r\n shardCount?: number;\r\n properties?: GatewayProperties;\r\n presence?: GatewayPresence;\r\n}\r\n\r\n/** REST request configuration. */\r\nexport interface RESTOptions {\r\n timeout?: number;\r\n retries?: number;\r\n baseURL?: string;\r\n}\r\n\r\n// ─── Core Discord Objects ─────────────────────────────────────────────────────\r\n\r\n/** Discord user object. */\r\nexport interface UserData {\r\n id: Snowflake;\r\n username: string;\r\n discriminator?: string;\r\n global_name?: string | null;\r\n avatar?: string | null;\r\n bot?: boolean;\r\n system?: boolean;\r\n public_flags?: number;\r\n}\r\n/** Current authenticated bot user. */\r\nexport type ClientUser = UserData;\r\n/** Discord Gateway payload envelope. */\r\nexport interface GatewayPayload<T = unknown> {\r\n op: number;\r\n d: T | null;\r\n s: number | null;\r\n t: string | null;\r\n}\r\n/** Generic Discord API error payload. */\r\nexport interface APIError {\r\n code?: number;\r\n message?: string;\r\n errors?: Record<string, unknown>;\r\n}\r\n\r\n// ─── Discord Flags & Enums ────────────────────────────────────────────────────\r\n\r\n/** Discord message flags. */\r\nexport const MessageFlags = {\r\n Crossposted: 1,\r\n IsCrosspost: 2,\r\n SuppressEmbeds: 4,\r\n SourceMessageDeleted: 8,\r\n Urgent: 16,\r\n HasThread: 32,\r\n Ephemeral: 64,\r\n Loading: 128,\r\n IsComponentsV2: 32768,\r\n} as const;\r\n\r\n/** Discord channel types. */\r\nexport const ChannelType = {\r\n GuildText: 0,\r\n DM: 1,\r\n GuildVoice: 2,\r\n GroupDM: 3,\r\n GuildCategory: 4,\r\n GuildAnnouncement: 5,\r\n AnnouncementThread: 10,\r\n PublicThread: 11,\r\n PrivateThread: 12,\r\n GuildStageVoice: 13,\r\n GuildDirectory: 14,\r\n GuildForum: 15,\r\n GuildMedia: 16,\r\n} as const;\r\n\r\n/** Discord component types. */\r\nexport const ComponentType = {\r\n ActionRow: 1,\r\n Button: 2,\r\n StringSelect: 3,\r\n TextInput: 4,\r\n UserSelect: 5,\r\n RoleSelect: 6,\r\n MentionableSelect: 7,\r\n ChannelSelect: 8,\r\n Section: 9,\r\n TextDisplay: 10,\r\n Thumbnail: 11,\r\n MediaGallery: 12,\r\n File: 13,\r\n Separator: 14,\r\n ContentInventoryEntry: 16,\r\n Container: 17,\r\n} as const;\r\n\r\n/** Discord button style types. */\r\nexport const ButtonStyle = {\r\n Primary: 1,\r\n Secondary: 2,\r\n Success: 3,\r\n Danger: 4,\r\n Link: 5,\r\n Premium: 6,\r\n} as const;\r\n\r\n/** Discord text input style types. */\r\nexport const TextInputStyle = {\r\n Short: 1,\r\n Paragraph: 2,\r\n} as const;\r\n\r\n/** Discord interaction response types. */\r\nexport const InteractionResponseType = {\r\n Pong: 1,\r\n ChannelMessage: 4,\r\n DeferredChannelMessage: 5,\r\n DeferredMessageUpdate: 6,\r\n MessageUpdate: 7,\r\n Autocomplete: 8,\r\n Modal: 9,\r\n} as const;\r\n\r\n/** Discord sticker format types. */\r\nexport const StickerFormatType = {\r\n PNG: 1,\r\n APNG: 2,\r\n Lottie: 3,\r\n GIF: 4,\r\n} as const;\r\n\r\n/** Discord sticker types. */\r\nexport const StickerType = {\r\n Standard: 1,\r\n Guild: 2,\r\n} as const;\r\n\r\n/** Discord verification levels. */\r\nexport const VerificationLevel = {\r\n None: 0,\r\n Low: 1,\r\n Medium: 2,\r\n High: 3,\r\n VeryHigh: 4,\r\n} as const;\r\n\r\n/** Discord premium tiers. */\r\nexport const PremiumTier = {\r\n None: 0,\r\n Tier1: 1,\r\n Tier2: 2,\r\n Tier3: 3,\r\n} as const;\r\n\r\n// ─── Embeds ───────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord embed footer object. */\r\nexport interface APIEmbedFooter {\r\n text: string;\r\n icon_url?: string;\r\n proxy_icon_url?: string;\r\n}\r\n/** Raw Discord embed image/thumbnail/video object. */\r\nexport interface APIEmbedMedia {\r\n url: string;\r\n proxy_url?: string;\r\n height?: number;\r\n width?: number;\r\n}\r\n/** Raw Discord embed provider object. */\r\nexport interface APIEmbedProvider {\r\n name?: string;\r\n url?: string;\r\n}\r\n/** Raw Discord embed author object. */\r\nexport interface APIEmbedAuthor {\r\n name: string;\r\n url?: string;\r\n icon_url?: string;\r\n proxy_icon_url?: string;\r\n}\r\n/** Raw Discord embed field object. */\r\nexport interface APIEmbedField {\r\n name: string;\r\n value: string;\r\n inline?: boolean;\r\n}\r\n/** Raw Discord embed object. */\r\nexport interface APIEmbed {\r\n title?: string;\r\n type?: string;\r\n description?: string;\r\n url?: string;\r\n timestamp?: string;\r\n color?: number;\r\n footer?: APIEmbedFooter;\r\n image?: APIEmbedMedia;\r\n thumbnail?: APIEmbedMedia;\r\n video?: APIEmbedMedia;\r\n provider?: APIEmbedProvider;\r\n author?: APIEmbedAuthor;\r\n fields?: APIEmbedField[];\r\n}\r\n\r\n// ─── Message Components ───────────────────────────────────────────────────────\r\n\r\n/** Raw Discord select menu option. */\r\nexport interface APISelectMenuOption {\r\n label: string;\r\n value: string;\r\n description?: string;\r\n emoji?: APIPartialEmoji;\r\n default?: boolean;\r\n}\r\n/** Raw Discord emoji (partial, as used in components). */\r\nexport interface APIPartialEmoji {\r\n id?: Snowflake | null;\r\n name?: string | null;\r\n animated?: boolean;\r\n}\r\n/** Raw Discord button component. */\r\nexport interface APIButtonComponent {\r\n type: 2;\r\n style: number;\r\n label?: string;\r\n emoji?: APIPartialEmoji;\r\n custom_id?: string;\r\n url?: string;\r\n sku_id?: string;\r\n disabled?: boolean;\r\n}\r\n/** Raw Discord select menu component. */\r\nexport interface APISelectMenuComponent {\r\n type: 3 | 5 | 6 | 7 | 8;\r\n custom_id: string;\r\n options?: APISelectMenuOption[];\r\n channel_types?: number[];\r\n placeholder?: string;\r\n min_values?: number;\r\n max_values?: number;\r\n disabled?: boolean;\r\n}\r\n/** Raw Discord text input component. */\r\nexport interface APITextInputComponent {\r\n type: 4;\r\n custom_id: string;\r\n style: number;\r\n label: string;\r\n min_length?: number;\r\n max_length?: number;\r\n required?: boolean;\r\n value?: string;\r\n placeholder?: string;\r\n}\r\n/** Union of all raw message component types. */\r\nexport type APIMessageActionRowComponent =\r\n APIButtonComponent | APISelectMenuComponent | APITextInputComponent;\r\n/** Raw Discord action row component. */\r\nexport interface APIActionRowComponent {\r\n type: 1;\r\n id?: number;\r\n components: APIMessageActionRowComponent[];\r\n}\r\n/** Union including action rows and V2 components. */\r\nexport type APIMessageComponent = APIActionRowComponent | { type: Exclude<number, 1>; [key: string]: any };\r\n\r\n// ─── Attachments ─────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord attachment object. */\r\nexport interface APIAttachment {\r\n id: Snowflake;\r\n filename: string;\r\n description?: string | null;\r\n content_type?: string;\r\n size: number;\r\n url: string;\r\n proxy_url: string;\r\n height?: number | null;\r\n width?: number | null;\r\n ephemeral?: boolean;\r\n duration_secs?: number;\r\n waveform?: string;\r\n flags?: number;\r\n}\r\n\r\n// ─── Stickers ────────────────────────────────────────────────────────────────\r\n\r\n/** Compact sticker item as included in messages. */\r\nexport interface APIStickerItem {\r\n id: Snowflake;\r\n name: string;\r\n format_type: number;\r\n}\r\n/** Full Discord sticker object. */\r\nexport interface APISticker {\r\n id: Snowflake;\r\n pack_id?: Snowflake;\r\n name: string;\r\n description?: string | null;\r\n tags?: string;\r\n type: number;\r\n format_type: number;\r\n available?: boolean;\r\n guild_id?: Snowflake;\r\n user?: UserData;\r\n sort_value?: number;\r\n}\r\n\r\n// ─── Messages ────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord message reference. */\r\nexport interface APIMessageReference {\r\n type?: number;\r\n message_id?: Snowflake;\r\n channel_id?: Snowflake;\r\n guild_id?: Snowflake;\r\n fail_if_not_exists?: boolean;\r\n}\r\n/** Raw Discord message reaction. */\r\nexport interface APIMessageReaction {\r\n count: number;\r\n count_details?: Record<string, number>;\r\n me?: boolean;\r\n me_burst?: boolean;\r\n emoji: APIPartialEmoji;\r\n burst_colors?: string[];\r\n}\r\n/** Raw Discord message object. */\r\nexport interface APIMessage {\r\n id: Snowflake;\r\n channel_id: Snowflake;\r\n author: UserData;\r\n content: string;\r\n timestamp?: string;\r\n edited_timestamp?: string | null;\r\n tts?: boolean;\r\n mention_everyone?: boolean;\r\n mentions?: UserData[];\r\n mention_roles?: Snowflake[];\r\n mention_channels?: Array<Record<string, unknown>>;\r\n attachments?: APIAttachment[];\r\n embeds?: APIEmbed[];\r\n reactions?: APIMessageReaction[];\r\n nonce?: string | number | null;\r\n pinned?: boolean;\r\n webhook_id?: Snowflake;\r\n type?: number;\r\n activity?: Record<string, unknown>;\r\n application?: Record<string, unknown>;\r\n application_id?: Snowflake;\r\n message_reference?: APIMessageReference;\r\n flags?: number;\r\n referenced_message?: APIMessage | null;\r\n interaction_metadata?: Record<string, unknown>;\r\n thread?: Record<string, unknown>;\r\n components?: APIMessageComponent[];\r\n sticker_items?: APIStickerItem[];\r\n stickers?: APISticker[];\r\n position?: number;\r\n role_subscription_data?: Record<string, unknown>;\r\n purchase_notification?: Record<string, unknown>;\r\n poll?: Record<string, unknown>;\r\n guild_id?: Snowflake;\r\n}\r\n\r\n// ─── Channels ────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord channel object. */\r\nexport interface APIChannel {\r\n id: Snowflake;\r\n type: number;\r\n guild_id?: Snowflake;\r\n position?: number;\r\n permission_overwrites?: Array<Record<string, unknown>>;\r\n name?: string | null;\r\n topic?: string | null;\r\n nsfw?: boolean;\r\n last_message_id?: Snowflake | null;\r\n bitrate?: number;\r\n user_limit?: number;\r\n rate_limit_per_user?: number;\r\n recipients?: UserData[];\r\n icon?: string | null;\r\n owner_id?: Snowflake;\r\n application_id?: Snowflake;\r\n parent_id?: Snowflake | null;\r\n last_pin_timestamp?: string | null;\r\n rtc_region?: string | null;\r\n video_quality_mode?: number;\r\n message_count?: number;\r\n member_count?: number;\r\n thread_metadata?: APIThreadMetadata;\r\n default_auto_archive_duration?: number;\r\n flags?: number;\r\n total_message_sent?: number;\r\n available_tags?: APIForumTag[];\r\n default_reaction_emoji?: APIPartialEmoji | null;\r\n default_thread_rate_limit_per_user?: number;\r\n default_sort_order?: number | null;\r\n default_forum_layout?: number;\r\n}\r\n\r\n/** Raw Discord thread metadata. */\r\nexport interface APIThreadMetadata {\r\n archived: boolean;\r\n auto_archive_duration: number;\r\n archive_timestamp: string;\r\n locked: boolean;\r\n invitable?: boolean;\r\n create_timestamp?: string | null;\r\n}\r\n\r\n/** Raw Discord forum tag. */\r\nexport interface APIForumTag {\r\n id: Snowflake;\r\n name: string;\r\n moderated: boolean;\r\n emoji_id?: Snowflake | null;\r\n emoji_name?: string | null;\r\n}\r\n\r\n/** Raw Discord thread member. */\r\nexport interface APIThreadMember {\r\n id?: Snowflake;\r\n user_id?: Snowflake;\r\n join_timestamp: string;\r\n flags: number;\r\n member?: APIGuildMember;\r\n}\r\n\r\n// ─── Roles ────────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord role object. */\r\nexport interface APIRole {\r\n id: Snowflake;\r\n name: string;\r\n color: number;\r\n hoist: boolean;\r\n icon?: string | null;\r\n unicode_emoji?: string | null;\r\n position: number;\r\n permissions: string;\r\n managed: boolean;\r\n mentionable: boolean;\r\n tags?: Record<string, unknown>;\r\n flags?: number;\r\n}\r\n\r\n// ─── Emoji ────────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord emoji object. */\r\nexport interface APIEmoji {\r\n id: Snowflake | null;\r\n name: string | null;\r\n roles?: Snowflake[];\r\n user?: UserData;\r\n require_colons?: boolean;\r\n managed?: boolean;\r\n animated?: boolean;\r\n available?: boolean;\r\n}\r\n\r\n// ─── Guilds ───────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord guild object. */\r\nexport interface APIGuild {\r\n id: Snowflake;\r\n name: string;\r\n icon?: string | null;\r\n icon_hash?: string | null;\r\n splash?: string | null;\r\n discovery_splash?: string | null;\r\n owner?: boolean;\r\n owner_id?: Snowflake;\r\n permissions?: string;\r\n afk_channel_id?: Snowflake | null;\r\n afk_timeout?: number;\r\n widget_enabled?: boolean;\r\n widget_channel_id?: Snowflake | null;\r\n verification_level?: number;\r\n default_message_notifications?: number;\r\n explicit_content_filter?: number;\r\n roles?: APIRole[];\r\n emojis?: APIEmoji[];\r\n stickers?: APISticker[];\r\n features?: string[];\r\n mfa_level?: number;\r\n application_id?: Snowflake | null;\r\n system_channel_id?: Snowflake | null;\r\n system_channel_flags?: number;\r\n rules_channel_id?: Snowflake | null;\r\n max_presences?: number | null;\r\n max_members?: number;\r\n vanity_url_code?: string | null;\r\n description?: string | null;\r\n banner?: string | null;\r\n premium_tier?: number;\r\n premium_subscription_count?: number;\r\n preferred_locale?: string;\r\n public_updates_channel_id?: Snowflake | null;\r\n max_video_channel_users?: number;\r\n approximate_member_count?: number;\r\n approximate_presence_count?: number;\r\n nsfw_level?: number;\r\n safety_alerts_channel_id?: Snowflake | null;\r\n member_count?: number;\r\n}\r\n\r\n/** Raw Discord guild member object. */\r\nexport interface APIGuildMember {\r\n user: UserData;\r\n nick?: string | null;\r\n avatar?: string | null;\r\n roles: Snowflake[];\r\n joined_at: string;\r\n premium_since?: string | null;\r\n deaf?: boolean;\r\n mute?: boolean;\r\n flags?: number;\r\n pending?: boolean;\r\n permissions?: string;\r\n communication_disabled_until?: string | null;\r\n guild_id?: Snowflake;\r\n}\r\n\r\n// ─── Voice ────────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord voice state object. */\r\nexport interface APIVoiceState {\r\n guild_id?: Snowflake;\r\n channel_id?: Snowflake | null;\r\n user_id: Snowflake;\r\n member?: APIGuildMember;\r\n session_id: string;\r\n deaf: boolean;\r\n mute: boolean;\r\n self_deaf: boolean;\r\n self_mute: boolean;\r\n self_stream?: boolean;\r\n self_video: boolean;\r\n suppress: boolean;\r\n request_to_speak_timestamp?: string | null;\r\n}\r\n\r\n/** Raw Discord voice server update event. */\r\nexport interface APIVoiceServerUpdate {\r\n token: string;\r\n guild_id: Snowflake;\r\n endpoint?: string | null;\r\n}\r\n\r\n// ─── Presence ────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord activity object. */\r\nexport interface APIActivity {\r\n name: string;\r\n type: number;\r\n url?: string | null;\r\n created_at: number;\r\n state?: string | null;\r\n details?: string | null;\r\n emoji?: APIPartialEmoji | null;\r\n}\r\n\r\n/** Raw Discord presence update event. */\r\nexport interface APIPresenceUpdate {\r\n user: { id: Snowflake } & Partial<UserData>;\r\n guild_id: Snowflake;\r\n status: string;\r\n activities: APIActivity[];\r\n client_status: { desktop?: string; mobile?: string; web?: string };\r\n}\r\n\r\n// ─── Typing ───────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord typing start event. */\r\nexport interface APITypingStart {\r\n channel_id: Snowflake;\r\n guild_id?: Snowflake;\r\n user_id: Snowflake;\r\n timestamp: number;\r\n member?: APIGuildMember;\r\n}\r\n\r\n// ─── Guilds ──────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord guild preview. */\r\nexport interface APIGuildPreview {\r\n id: Snowflake;\r\n name: string;\r\n icon: string | null;\r\n splash: string | null;\r\n discovery_splash: string | null;\r\n emojis: unknown[];\r\n features: string[];\r\n approximate_member_count: number;\r\n approximate_presence_count: number;\r\n description: string | null;\r\n stickers: unknown[];\r\n}\r\n\r\n// ─── Invites ─────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord invite. */\r\nexport interface APIInvite {\r\n code: string;\r\n guild?: Partial<APIGuild>;\r\n channel: Partial<APIChannel>;\r\n inviter?: UserData;\r\n target_type?: number;\r\n target_user?: UserData;\r\n approximate_presence_count?: number;\r\n approximate_member_count?: number;\r\n}\r\n\r\n/** Raw Discord invite create event. */\r\nexport interface APIInviteCreate {\r\n channel_id: Snowflake;\r\n code: string;\r\n created_at: string;\r\n guild_id?: Snowflake;\r\n inviter?: UserData;\r\n max_age: number;\r\n max_uses: number;\r\n target_type?: number;\r\n target_user?: UserData;\r\n temporary: boolean;\r\n uses: number;\r\n}\r\n\r\n/** Raw Discord invite delete event. */\r\nexport interface APIInviteDelete {\r\n channel_id: Snowflake;\r\n guild_id?: Snowflake;\r\n code: string;\r\n}\r\n\r\n// ─── Webhooks ────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord webhooks update event. */\r\nexport interface APIWebhooksUpdate {\r\n guild_id: Snowflake;\r\n channel_id: Snowflake;\r\n}\r\n\r\n/** Raw Discord webhook object. */\r\nexport interface APIWebhook {\r\n id: Snowflake;\r\n type: number;\r\n guild_id?: Snowflake | null;\r\n channel_id?: Snowflake | null;\r\n user?: UserData;\r\n name?: string | null;\r\n avatar?: string | null;\r\n token?: string;\r\n application_id?: Snowflake | null;\r\n url?: string;\r\n}\r\n\r\n// ─── AutoMod ─────────────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord AutoMod action. */\r\nexport interface APIAutoModerationAction {\r\n type: number;\r\n metadata?: {\r\n channel_id?: Snowflake;\r\n duration_seconds?: number;\r\n custom_message?: string;\r\n };\r\n}\r\n\r\n/** Raw Discord AutoMod rule object. */\r\nexport interface APIAutoModerationRule {\r\n id: Snowflake;\r\n guild_id: Snowflake;\r\n name: string;\r\n creator_id: Snowflake;\r\n event_type: number;\r\n trigger_type: number;\r\n trigger_metadata: Record<string, unknown>;\r\n actions: APIAutoModerationAction[];\r\n enabled: boolean;\r\n exempt_roles: Snowflake[];\r\n exempt_channels: Snowflake[];\r\n}\r\n\r\n/** Raw Discord AutoMod action execution event. */\r\nexport interface APIAutoModerationActionExecution {\r\n guild_id: Snowflake;\r\n action: APIAutoModerationAction;\r\n rule_id: Snowflake;\r\n rule_trigger_type: number;\r\n user_id: Snowflake;\r\n channel_id?: Snowflake;\r\n message_id?: Snowflake;\r\n alert_system_message_id?: Snowflake;\r\n content: string;\r\n matched_keyword?: string | null;\r\n matched_content?: string | null;\r\n}\r\n\r\n// ─── Scheduled Events ─────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord guild scheduled event entity metadata. */\r\nexport interface APIGuildScheduledEventEntityMetadata {\r\n location?: string;\r\n}\r\n\r\n/** Raw Discord guild scheduled event object. */\r\nexport interface APIGuildScheduledEvent {\r\n id: Snowflake;\r\n guild_id: Snowflake;\r\n channel_id?: Snowflake | null;\r\n creator_id?: Snowflake | null;\r\n name: string;\r\n description?: string | null;\r\n scheduled_start_time: string;\r\n scheduled_end_time?: string | null;\r\n privacy_level: number;\r\n status: number;\r\n entity_type: number;\r\n entity_id?: Snowflake | null;\r\n entity_metadata?: APIGuildScheduledEventEntityMetadata | null;\r\n creator?: UserData;\r\n user_count?: number;\r\n image?: string | null;\r\n}\r\n\r\n// ─── Stage Instances ─────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord stage instance object. */\r\nexport interface APIStageInstance {\r\n id: Snowflake;\r\n guild_id: Snowflake;\r\n channel_id: Snowflake;\r\n topic: string;\r\n privacy_level: number;\r\n discoverable_disabled?: boolean;\r\n guild_scheduled_event_id?: Snowflake | null;\r\n}\r\n\r\n// ─── Application Commands ─────────────────────────────────────────────────────\r\n\r\n/** Discord application command option types. */\r\nexport const ApplicationCommandOptionType = {\r\n SubCommand: 1,\r\n SubCommandGroup: 2,\r\n String: 3,\r\n Integer: 4,\r\n Boolean: 5,\r\n User: 6,\r\n Channel: 7,\r\n Role: 8,\r\n Mentionable: 9,\r\n Number: 10,\r\n Attachment: 11,\r\n} as const;\r\n\r\n/** Discord application command types. */\r\nexport const ApplicationCommandType = {\r\n ChatInput: 1,\r\n User: 2,\r\n Message: 3,\r\n} as const;\r\n\r\n/** Raw Discord application command option. */\r\nexport interface APIApplicationCommandOption {\r\n type: number;\r\n name: string;\r\n description: string;\r\n required?: boolean;\r\n choices?: Array<{ name: string; value: string | number }>;\r\n options?: APIApplicationCommandOption[];\r\n min_value?: number;\r\n max_value?: number;\r\n min_length?: number;\r\n max_length?: number;\r\n autocomplete?: boolean;\r\n channel_types?: number[];\r\n}\r\n\r\n/** Raw Discord application command object (from API). */\r\nexport interface APIApplicationCommand {\r\n id: Snowflake;\r\n type?: number;\r\n application_id: Snowflake;\r\n guild_id?: Snowflake;\r\n name: string;\r\n description: string;\r\n options?: APIApplicationCommandOption[];\r\n default_member_permissions?: string | null;\r\n dm_permission?: boolean;\r\n nsfw?: boolean;\r\n version: Snowflake;\r\n}\r\n\r\n/** Data for creating/overwriting an application command. */\r\nexport interface ApplicationCommandData {\r\n name: string;\r\n description: string;\r\n type?: number;\r\n options?: APIApplicationCommandOption[];\r\n default_member_permissions?: string | null;\r\n dm_permission?: boolean;\r\n nsfw?: boolean;\r\n}\r\n\r\n// ─── Gateway Events ───────────────────────────────────────────────────────────\r\n\r\n/** Raw Discord READY event payload. */\r\nexport interface APIReadyEvent {\r\n v: number;\r\n user: UserData;\r\n guilds: Array<{ id: Snowflake; unavailable?: boolean }>;\r\n session_id: string;\r\n resume_gateway_url: string;\r\n shard?: [number, number];\r\n application?: { id: Snowflake; flags: number; [key: string]: unknown };\r\n}\r\n\r\n/** Raw Discord reaction event payload. */\r\nexport interface APIMessageReactionEvent {\r\n user_id: Snowflake;\r\n channel_id: Snowflake;\r\n message_id: Snowflake;\r\n guild_id?: Snowflake;\r\n member?: APIGuildMember;\r\n emoji: APIPartialEmoji;\r\n message_author_id?: Snowflake;\r\n burst?: boolean;\r\n type?: number;\r\n}\r\n\r\n/** Raw Discord reaction remove emoji event payload. */\r\nexport interface APIMessageReactionRemoveEmojiEvent {\r\n channel_id: Snowflake;\r\n guild_id?: Snowflake;\r\n message_id: Snowflake;\r\n emoji: APIPartialEmoji;\r\n}\r\n\r\n/** Raw Discord message deletion event payload. */\r\nexport interface APIMessageDeleteEvent {\r\n id: Snowflake;\r\n channel_id: Snowflake;\r\n guild_id?: Snowflake;\r\n}\r\n\r\n/** Raw Discord bulk message deletion event payload. */\r\nexport interface APIMessageDeleteBulkEvent {\r\n ids: Snowflake[];\r\n channel_id: Snowflake;\r\n guild_id?: Snowflake;\r\n}\r\n\r\n/** Raw Discord channel deletion event payload. */\r\nexport interface APIChannelDeleteEvent extends APIChannel {}\r\n\r\n/** Raw Discord guild deletion event payload. */\r\nexport interface APIGuildDeleteEvent {\r\n id: Snowflake;\r\n unavailable?: boolean;\r\n}\r\n\r\n/** Raw Discord thread lifecycle payload. */\r\nexport interface APIThreadEvent extends APIChannel {\r\n guild_id: Snowflake;\r\n member?: APIThreadMember;\r\n}\r\n\r\n/** Raw Discord thread list sync event. */\r\nexport interface APIThreadListSync {\r\n guild_id: Snowflake;\r\n channel_ids?: Snowflake[];\r\n threads: APIChannel[];\r\n members: APIThreadMember[];\r\n}\r\n\r\n/** Raw Discord thread members update event. */\r\nexport interface APIThreadMembersUpdate {\r\n id: Snowflake;\r\n guild_id: Snowflake;\r\n member_count: number;\r\n added_members?: APIThreadMember[];\r\n removed_member_ids?: Snowflake[];\r\n}\r\n\r\n/** Raw Discord guild role event payload. */\r\nexport interface APIGuildRoleEvent {\r\n guild_id: Snowflake;\r\n role: APIRole;\r\n}\r\n\r\n/** Raw Discord guild role delete event payload. */\r\nexport interface APIGuildRoleDeleteEvent {\r\n guild_id: Snowflake;\r\n role_id: Snowflake;\r\n}\r\n\r\n/** Raw Discord guild ban event payload. */\r\nexport interface APIGuildBanEvent {\r\n guild_id: Snowflake;\r\n user: UserData;\r\n}\r\n\r\n/** Raw Discord guild emojis update event payload. */\r\nexport interface APIGuildEmojisUpdateEvent {\r\n guild_id: Snowflake;\r\n emojis: APIEmoji[];\r\n}\r\n\r\n/** Raw Discord guild stickers update event payload. */\r\nexport interface APIGuildStickersUpdateEvent {\r\n guild_id: Snowflake;\r\n stickers: APISticker[];\r\n}\r\n\r\n/** Raw Discord channel pins update event. */\r\nexport interface APIChannelPinsUpdate {\r\n guild_id?: Snowflake;\r\n channel_id: Snowflake;\r\n last_pin_timestamp?: string | null;\r\n}\r\n\r\n/** Raw Discord guild members chunk event. */\r\nexport interface APIGuildMembersChunk {\r\n guild_id: Snowflake;\r\n members: APIGuildMember[];\r\n chunk_index: number;\r\n chunk_count: number;\r\n not_found?: Snowflake[];\r\n presences?: APIPresenceUpdate[];\r\n nonce?: string;\r\n}\r\n\r\n/** Raw Discord guild scheduled event user add/remove event. */\r\nexport interface APIGuildScheduledEventUserEvent {\r\n guild_scheduled_event_id: Snowflake;\r\n user_id: Snowflake;\r\n guild_id: Snowflake;\r\n}\r\n\r\n/** Raw Discord message poll vote add/remove event. */\r\nexport interface APIMessagePollVoteEvent {\r\n user_id: Snowflake;\r\n channel_id: Snowflake;\r\n message_id: Snowflake;\r\n guild_id?: Snowflake;\r\n answer_id: number;\r\n}\r\n",
|
|
9
|
+
"import { InteractionResponseType } from \"@lunibee/types\";\r\n\r\n/** Discord interaction type constants. */\r\nexport const InteractionType = {\r\n Ping: 1,\r\n ApplicationCommand: 2,\r\n MessageComponent: 3,\r\n ApplicationCommandAutocomplete: 4,\r\n ModalSubmit: 5,\r\n} as const;\r\n// Re-export for consumers who import from structures directly\r\nexport { InteractionResponseType } from \"@lunibee/types\";\r\n/** Data shared by Discord interactions. */\r\nexport interface InteractionData {\r\n /** Interaction identifier. */ id: string;\r\n /** Application identifier. */ application_id: string;\r\n /** Interaction type. */ type: number;\r\n /** Interaction token. */ token: string;\r\n /** Gateway/API version. */ version?: number;\r\n /** Guild identifier. */ guild_id?: string;\r\n /** Channel identifier. */ channel_id?: string;\r\n /** Interaction-specific data. */ data?: Record<string, unknown>;\r\n [key: string]: unknown;\r\n}\r\n/** Options for an interaction response message. */\r\nexport interface InteractionReplyOptions {\r\n /** Message content. */ content?: string;\r\n /** Whether the response is ephemeral. */ ephemeral?: boolean;\r\n /** Message components. */ components?: unknown[];\r\n /** Message embeds. */ embeds?: unknown[];\r\n /** Discord message flags. */ flags?: number;\r\n [key: string]: unknown;\r\n}\r\n/** Transport required by an interaction structure. */\r\nexport interface InteractionClient {\r\n /** 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. */ postInteractionResponse(\r\n id: string,\r\n token: string,\r\n response: InteractionResponse,\r\n ): Promise<unknown>;\r\n /** Edits the original interaction response. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */ editInteractionReply(\r\n token: string,\r\n data: InteractionReplyOptions,\r\n ): Promise<unknown>;\r\n /** Deletes the original interaction response. @param token Interaction token. @returns Promise fulfilled after deletion. @throws {Error} When REST fails. */ deleteInteractionReply(\r\n token: string,\r\n ): Promise<void>;\r\n /** Sends a follow-up interaction webhook message. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */ followUpInteraction(\r\n token: string,\r\n data: InteractionReplyOptions,\r\n ): Promise<unknown>;\r\n}\r\n\r\n// ─── Raw option type from Discord ────────────────────────────────────────────\r\n\r\n/** Raw Discord application command interaction data option. */\r\nexport interface APIInteractionDataOption {\r\n name: string;\r\n type: number;\r\n value?: string | number | boolean;\r\n options?: APIInteractionDataOption[];\r\n focused?: boolean;\r\n}\r\n\r\n// ─── CommandOptions resolver ──────────────────────────────────────────────────\r\n\r\n/** Application command option types mirroring Discord's enum. */\r\nconst OptionType = {\r\n SubCommand: 1,\r\n SubCommandGroup: 2,\r\n String: 3,\r\n Integer: 4,\r\n Boolean: 5,\r\n User: 6,\r\n Channel: 7,\r\n Role: 8,\r\n Mentionable: 9,\r\n Number: 10,\r\n Attachment: 11,\r\n} as const;\r\n\r\n/**\r\n * Typed resolver for application command options.\r\n * Attached as `CommandInteraction.options`.\r\n */\r\nexport class CommandOptions {\r\n readonly #options: APIInteractionDataOption[];\r\n readonly #resolved: Record<string, unknown>;\r\n\r\n /** @internal */\r\n public constructor(\r\n options: APIInteractionDataOption[],\r\n resolved: Record<string, unknown> = {},\r\n ) {\r\n let currentOptions = options;\r\n let group: string | null = null;\r\n let sub: string | null = null;\r\n \r\n // Drill down to the deepest options level for nested subcommands\r\n while (currentOptions.length === 1) {\r\n const opt = currentOptions[0]!;\r\n if (opt.type === OptionType.SubCommandGroup) {\r\n group = opt.name;\r\n currentOptions = opt.options ?? [];\r\n } else if (opt.type === OptionType.SubCommand) {\r\n sub = opt.name;\r\n currentOptions = opt.options ?? [];\r\n } else {\r\n break;\r\n }\r\n }\r\n \r\n this.#options = currentOptions;\r\n this.#resolved = resolved;\r\n this.#subcommandGroup = group;\r\n this.#subcommand = sub;\r\n }\r\n \r\n readonly #subcommandGroup: string | null;\r\n readonly #subcommand: string | null;\r\n\r\n /** Finds a raw option by name (case-insensitive). */\r\n #get(name: string): APIInteractionDataOption | undefined {\r\n return this.#options.find(\r\n (o) => o.name.toLowerCase() === name.toLowerCase(),\r\n );\r\n }\r\n\r\n // ── Subcommand resolution ──────────────────────────────────────────────────\r\n\r\n /** Returns the invoked subcommand name, or null if none. */\r\n public getSubcommand(required?: false): string | null;\r\n public getSubcommand(required: true): string;\r\n public getSubcommand(required = false): string | null {\r\n if (!this.#subcommand && required) {\r\n throw new TypeError(\"No subcommand was provided.\");\r\n }\r\n return this.#subcommand;\r\n }\r\n\r\n /** Returns the invoked subcommand group name, or null if none. */\r\n public getSubcommandGroup(required?: false): string | null;\r\n public getSubcommandGroup(required: true): string;\r\n public getSubcommandGroup(required = false): string | null {\r\n if (!this.#subcommandGroup && required) {\r\n throw new TypeError(\"No subcommand group was provided.\");\r\n }\r\n return this.#subcommandGroup;\r\n }\r\n\r\n // ── Primitive value options ────────────────────────────────────────────────\r\n\r\n /** Gets a string option. @param name Option name. @param required If true, throws when missing. */\r\n public getString(name: string, required?: false): string | null;\r\n public getString(name: string, required: true): string;\r\n public getString(name: string, required = false): string | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.String) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (string) is missing.`);\r\n return null;\r\n }\r\n return typeof opt.value === \"string\" ? opt.value : null;\r\n }\r\n\r\n /** Gets an integer option. @param name Option name. @param required If true, throws when missing. */\r\n public getInteger(name: string, required?: false): number | null;\r\n public getInteger(name: string, required: true): number;\r\n public getInteger(name: string, required = false): number | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Integer) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (integer) is missing.`);\r\n return null;\r\n }\r\n return typeof opt.value === \"number\" ? Math.trunc(opt.value) : null;\r\n }\r\n\r\n /** Gets a number (float) option. @param name Option name. @param required If true, throws when missing. */\r\n public getNumber(name: string, required?: false): number | null;\r\n public getNumber(name: string, required: true): number;\r\n public getNumber(name: string, required = false): number | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Number) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (number) is missing.`);\r\n return null;\r\n }\r\n return typeof opt.value === \"number\" ? opt.value : null;\r\n }\r\n\r\n /** Gets a boolean option. @param name Option name. @param required If true, throws when missing. */\r\n public getBoolean(name: string, required?: false): boolean | null;\r\n public getBoolean(name: string, required: true): boolean;\r\n public getBoolean(name: string, required = false): boolean | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Boolean) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (boolean) is missing.`);\r\n return null;\r\n }\r\n return typeof opt.value === \"boolean\" ? opt.value : null;\r\n }\r\n\r\n // ── Resolved entity options ────────────────────────────────────────────────\r\n\r\n /** Gets the raw resolved user data for a user option. @param name Option name. @param required If true, throws when missing. */\r\n public getUser(\r\n name: string,\r\n required?: false,\r\n ): Record<string, unknown> | null;\r\n public getUser(name: string, required: true): Record<string, unknown>;\r\n public getUser(\r\n name: string,\r\n required = false,\r\n ): Record<string, unknown> | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.User) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (user) is missing.`);\r\n return null;\r\n }\r\n const userId = String(opt.value);\r\n const resolved = (this.#resolved as any)?.users?.[userId] ?? null;\r\n if (!resolved && required)\r\n throw new TypeError(`Resolved user for option \"${name}\" is missing.`);\r\n return resolved;\r\n }\r\n\r\n /** Gets the raw resolved channel data for a channel option. @param name Option name. @param required If true, throws when missing. */\r\n public getChannel(\r\n name: string,\r\n required?: false,\r\n ): Record<string, unknown> | null;\r\n public getChannel(name: string, required: true): Record<string, unknown>;\r\n public getChannel(\r\n name: string,\r\n required = false,\r\n ): Record<string, unknown> | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Channel) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (channel) is missing.`);\r\n return null;\r\n }\r\n const channelId = String(opt.value);\r\n const resolved = (this.#resolved as any)?.channels?.[channelId] ?? null;\r\n if (!resolved && required)\r\n throw new TypeError(`Resolved channel for option \"${name}\" is missing.`);\r\n return resolved;\r\n }\r\n\r\n /** Gets the raw resolved role data for a role option. @param name Option name. @param required If true, throws when missing. */\r\n public getRole(\r\n name: string,\r\n required?: false,\r\n ): Record<string, unknown> | null;\r\n public getRole(name: string, required: true): Record<string, unknown>;\r\n public getRole(\r\n name: string,\r\n required = false,\r\n ): Record<string, unknown> | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Role) {\r\n if (required)\r\n throw new TypeError(`Required option \"${name}\" (role) is missing.`);\r\n return null;\r\n }\r\n const roleId = String(opt.value);\r\n const resolved = (this.#resolved as any)?.roles?.[roleId] ?? null;\r\n if (!resolved && required)\r\n throw new TypeError(`Resolved role for option \"${name}\" is missing.`);\r\n return resolved;\r\n }\r\n\r\n /** Gets the raw resolved user or role data for a mentionable option. @param name Option name. @param required If true, throws when missing. */\r\n public getMentionable(\r\n name: string,\r\n required?: false,\r\n ): Record<string, unknown> | null;\r\n public getMentionable(name: string, required: true): Record<string, unknown>;\r\n public getMentionable(\r\n name: string,\r\n required = false,\r\n ): Record<string, unknown> | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Mentionable) {\r\n if (required)\r\n throw new TypeError(\r\n `Required option \"${name}\" (mentionable) is missing.`,\r\n );\r\n return null;\r\n }\r\n const id = String(opt.value);\r\n const resolved =\r\n (this.#resolved as any)?.users?.[id] ??\r\n (this.#resolved as any)?.roles?.[id] ??\r\n null;\r\n if (!resolved && required)\r\n throw new TypeError(\r\n `Resolved mentionable for option \"${name}\" is missing.`,\r\n );\r\n return resolved;\r\n }\r\n\r\n /** Gets the raw resolved attachment data for an attachment option. @param name Option name. @param required If true, throws when missing. */\r\n public getAttachment(\r\n name: string,\r\n required?: false,\r\n ): Record<string, unknown> | null;\r\n public getAttachment(name: string, required: true): Record<string, unknown>;\r\n public getAttachment(\r\n name: string,\r\n required = false,\r\n ): Record<string, unknown> | null {\r\n const opt = this.#get(name);\r\n if (!opt || opt.type !== OptionType.Attachment) {\r\n if (required)\r\n throw new TypeError(\r\n `Required option \"${name}\" (attachment) is missing.`,\r\n );\r\n return null;\r\n }\r\n const attachmentId = String(opt.value);\r\n const resolved =\r\n (this.#resolved as any)?.attachments?.[attachmentId] ?? null;\r\n if (!resolved && required)\r\n throw new TypeError(\r\n `Resolved attachment for option \"${name}\" is missing.`,\r\n );\r\n return resolved;\r\n }\r\n\r\n /** Returns the raw option list for advanced use cases. */\r\n public get raw(): readonly APIInteractionDataOption[] {\r\n return this.#options;\r\n }\r\n}\r\n\r\n// ─── Response class ───────────────────────────────────────────────────────────\r\n\r\n/** A Discord interaction callback payload. */\r\nexport class InteractionResponse {\r\n readonly type: number;\r\n readonly data?: InteractionReplyOptions;\r\n /** Creates a response payload. @param type Discord callback type. @param data Optional callback data. @throws {TypeError} If type is not finite. */\r\n public constructor(type: number, data?: InteractionReplyOptions) {\r\n if (!Number.isFinite(type))\r\n throw new TypeError(\"Interaction response type must be finite.\");\r\n this.type = type;\r\n this.data = data;\r\n }\r\n /** Serializes the response for Discord. @returns Discord callback payload. */ public toJSON(): {\r\n type: number;\r\n data?: InteractionReplyOptions;\r\n } {\r\n return this.data === undefined\r\n ? { type: this.type }\r\n : { type: this.type, data: this.data };\r\n }\r\n /** Creates an immediate message response. @param options Response message options. @returns Callback payload. */ public static message(\r\n options: InteractionReplyOptions,\r\n ): InteractionResponse {\r\n const data: InteractionReplyOptions = { ...options };\r\n if (options.ephemeral) {\r\n data.flags = (typeof options.flags === \"number\" ? options.flags : 0) | 64;\r\n }\r\n return new InteractionResponse(\r\n InteractionResponseType.ChannelMessage,\r\n data,\r\n );\r\n }\r\n /** Creates a deferred channel response. @param ephemeral Whether the eventual response is ephemeral. @returns Callback payload. */ public static defer(\r\n ephemeral = false,\r\n ): InteractionResponse {\r\n return new InteractionResponse(\r\n InteractionResponseType.DeferredChannelMessage,\r\n ephemeral ? { flags: 64 } : undefined,\r\n );\r\n }\r\n /** Creates a Pong response. @returns Callback payload. */ public static pong(): InteractionResponse {\r\n return new InteractionResponse(InteractionResponseType.Pong);\r\n }\r\n}\r\n\r\n// ─── Base Interaction ─────────────────────────────────────────────────────────\r\n\r\n/** Base interaction structure. */\r\nexport class Interaction<TData extends InteractionData = InteractionData> {\r\n /** Interaction identifier. */ public readonly id: string;\r\n /** Application identifier. */ public readonly applicationId: string;\r\n /** Interaction token. */ public readonly token: string;\r\n /** Guild identifier. */ public readonly guildId?: string;\r\n /** Channel identifier. */ public readonly channelId?: string;\r\n /** Interaction type. */ public readonly type: number;\r\n /** Raw interaction data. */ public readonly data: TData;\r\n /** Whether the initial response was sent. */ public replied = false;\r\n /** Whether the initial response was deferred. */ public deferred = false;\r\n readonly #client: InteractionClient;\r\n /** Creates an interaction from a Gateway payload. @param client Interaction transport. @param data Gateway interaction payload. @throws {TypeError} If required identifiers are missing. */ public constructor(\r\n client: InteractionClient,\r\n data: TData,\r\n ) {\r\n if (!data.id || !data.token)\r\n throw new TypeError(\"Interaction ID and token are required.\");\r\n this.#client = client;\r\n this.id = data.id;\r\n this.applicationId = data.application_id;\r\n this.token = data.token;\r\n this.guildId = data.guild_id;\r\n this.channelId = data.channel_id;\r\n this.type = data.type;\r\n this.data = data;\r\n }\r\n /** Whether this interaction is an application command. @returns True for application command interactions. */ public isChatInputCommand(): this is CommandInteraction {\r\n return this.type === InteractionType.ApplicationCommand;\r\n }\r\n /** Whether this interaction is a message component. @returns True for component interactions. */ public isMessageComponent(): this is ComponentInteraction {\r\n return this.type === InteractionType.MessageComponent;\r\n }\r\n /** Whether this interaction is a modal submission. @returns True for modal submissions. */ public isModalSubmit(): this is ModalSubmitInteraction {\r\n return this.type === InteractionType.ModalSubmit;\r\n }\r\n /** Whether this interaction is autocomplete. @returns True for autocomplete interactions. */ public isAutocomplete(): this is AutocompleteInteraction {\r\n return this.type === InteractionType.ApplicationCommandAutocomplete;\r\n }\r\n /** Ensures the interaction has not already been acknowledged. @returns Nothing. @throws {Error} When already acknowledged. */ protected assertUnacknowledged(): void {\r\n if (this.replied || this.deferred)\r\n throw new Error(\"Interaction has already been acknowledged.\");\r\n }\r\n /** Ensures the interaction has been acknowledged. @returns Nothing. @throws {Error} When not acknowledged. */ protected assertAcknowledged(): void {\r\n if (!this.replied && !this.deferred)\r\n throw new Error(\"Interaction has not been acknowledged.\");\r\n }\r\n /** Posts a raw interaction response callback. */\r\n protected postResponse(response: InteractionResponse): Promise<unknown> {\r\n return this.#client.postInteractionResponse(this.id, this.token, response);\r\n }\r\n /** Sends the initial interaction response. @param options Response message options. @returns Discord response. @throws {Error} When already acknowledged or REST fails. */ public async reply(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n const result = await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n InteractionResponse.message(payload),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n /** Defers the initial interaction response. @param ephemeral Whether the eventual response is ephemeral. @returns Promise fulfilled after acknowledgement. @throws {Error} When already acknowledged or REST fails. */ public async deferReply(\r\n ephemeral = false,\r\n ): Promise<void> {\r\n this.assertUnacknowledged();\r\n await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n InteractionResponse.defer(ephemeral),\r\n );\r\n this.deferred = true;\r\n }\r\n /** Edits the original response. @param options Replacement message options. @returns Discord response. @throws {Error} When not acknowledged or REST fails. */ public editReply(\r\n options: InteractionReplyOptions,\r\n ): Promise<unknown> {\r\n this.assertAcknowledged();\r\n return this.#client.editInteractionReply(this.token, options);\r\n }\r\n /** Deletes the original response. @returns Promise fulfilled after deletion. @throws {Error} When not acknowledged or REST fails. */ public deleteReply(): Promise<void> {\r\n this.assertAcknowledged();\r\n return this.#client.deleteInteractionReply(this.token);\r\n }\r\n /** Sends a follow-up message using the interaction webhook. @param options Follow-up message options. @returns Discord response. @throws {Error} When REST fails. */ public followUp(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n return this.#client.followUpInteraction(this.token, payload);\r\n }\r\n /** Updates the message for a component interaction. */ public async update(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n const result = await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n new InteractionResponse(InteractionResponseType.MessageUpdate, payload),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n /** 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. */\r\n public async showModal(modal: {\r\n custom_id: string;\r\n title: string;\r\n components: unknown[];\r\n [key: string]: unknown;\r\n }): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const result = await this.#client.postInteractionResponse(\r\n this.id,\r\n this.token,\r\n new InteractionResponse(\r\n InteractionResponseType.Modal,\r\n modal as InteractionReplyOptions,\r\n ),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n}\r\n\r\n// ─── CommandInteraction ───────────────────────────────────────────────────────\r\n\r\n/** Application command interaction with fully typed option resolver. */\r\nexport class CommandInteraction extends Interaction {\r\n /** Typed option resolver. Access slash command options with full type safety. */\r\n public readonly options: CommandOptions;\r\n\r\n /** Invoked command name. @returns Command name or an empty string. */ public get commandName(): string {\r\n return typeof this.data.data?.name === \"string\" ? this.data.data.name : \"\";\r\n }\r\n\r\n public constructor(client: InteractionClient, data: InteractionData) {\r\n super(client, data);\r\n const rawOptions = (data.data?.options as APIInteractionDataOption[]) ?? [];\r\n const resolved = (data.data?.resolved as Record<string, unknown>) ?? {};\r\n // If a subcommand is present, drill into its options for the resolver\r\n const sub = rawOptions.find(\r\n (o) =>\r\n o.type === 1 /* SubCommand */ || o.type === 2 /* SubCommandGroup */,\r\n );\r\n this.options = new CommandOptions(sub?.options ?? rawOptions, resolved);\r\n }\r\n}\r\n\r\n// ─── ComponentInteraction ─────────────────────────────────────────────────────\r\n\r\n/** Message component interaction. */\r\nexport class ComponentInteraction extends Interaction {\r\n /** Gets component custom ID. */\r\n public get customId(): string {\r\n return (this.data as any)?.data?.custom_id ?? \"\";\r\n }\r\n /** Gets component type. */\r\n public get componentType(): number {\r\n return (this.data as any)?.data?.component_type ?? 0;\r\n }\r\n /** Gets selected values for select menu component interactions. */\r\n public get values(): string[] {\r\n return (this.data as any)?.data?.values ?? [];\r\n }\r\n /** Defers updating the message to which the component was attached. */\r\n public async deferUpdate(): Promise<void> {\r\n this.assertUnacknowledged();\r\n await this.postResponse(\r\n new InteractionResponse(InteractionResponseType.DeferredMessageUpdate),\r\n );\r\n this.deferred = true;\r\n }\r\n /** Updates the message to which the component was attached. */\r\n public override async update(\r\n options: InteractionReplyOptions | string,\r\n ): Promise<unknown> {\r\n this.assertUnacknowledged();\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : options;\r\n const result = await this.postResponse(\r\n new InteractionResponse(InteractionResponseType.MessageUpdate, payload),\r\n );\r\n this.replied = true;\r\n return result;\r\n }\r\n}\r\n\r\n// ─── ModalSubmitInteraction ───────────────────────────────────────────────────\r\n\r\n/** Represents a Discord modal submission interaction. */\r\nexport class ModalSubmitInteraction extends Interaction {\r\n /** Gets the submitted modal custom ID. */\r\n public get customId(): string {\r\n return (this.data as any)?.data?.custom_id ?? \"\";\r\n }\r\n\r\n /** Retrieves the text value for a specific text input custom ID. @param customId The custom_id of the text input component. @returns The submitted text, or undefined if not found. */\r\n public getInputValue(customId: string): string | undefined {\r\n const rows = (this.data as any)?.data?.components ?? [];\r\n for (const row of rows) {\r\n for (const comp of row.components ?? []) {\r\n if (comp.custom_id === customId) return comp.value;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Retrieves the text value for a text input, throwing if missing. @param customId The custom_id of the text input component. @returns The submitted text. @throws {TypeError} If the field is not found. */\r\n public getRequiredInputValue(customId: string): string {\r\n const value = this.getInputValue(customId);\r\n if (value === undefined)\r\n throw new TypeError(\r\n `Modal input \"${customId}\" was not found in the submission.`,\r\n );\r\n return value;\r\n }\r\n}\r\n\r\n// ─── AutocompleteInteraction ──────────────────────────────────────────────────\r\n\r\n/** Represents a Discord slash command autocomplete interaction. */\r\nexport class AutocompleteInteraction extends Interaction {\r\n /** Gets the target command name. */\r\n public get commandName(): string {\r\n return (this.data as any)?.data?.name ?? \"\";\r\n }\r\n\r\n /** Gets the currently focused autocomplete option. */\r\n public get focusedOption():\r\n { name: string; value: unknown; type: number } | undefined {\r\n const options = (this.data as any)?.data?.options ?? [];\r\n return findFocused(options);\r\n }\r\n\r\n /** Responds to Discord with autocomplete choices. @param choices Array of name/value pairs to show. @throws {TypeError} If choices is not an array. */\r\n public async respond(\r\n choices: { name: string; value: string | number }[],\r\n ): Promise<void> {\r\n if (!Array.isArray(choices))\r\n throw new TypeError(\"Autocomplete choices must be an array.\");\r\n const response = new InteractionResponse(\r\n InteractionResponseType.Autocomplete,\r\n { choices } as InteractionReplyOptions,\r\n );\r\n await this.postResponse(response);\r\n this.replied = true;\r\n }\r\n}\r\n\r\n/** Recursively finds the focused option in a nested options tree. */\r\nfunction findFocused(\r\n options: any[],\r\n): { name: string; value: unknown; type: number } | undefined {\r\n for (const opt of options) {\r\n if (opt.focused)\r\n return { name: opt.name, value: opt.value, type: opt.type };\r\n if (Array.isArray(opt.options)) {\r\n const found = findFocused(opt.options);\r\n if (found) return found;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\n// ─── Factory ──────────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Creates a specialized interaction structure for a Gateway payload.\r\n * @param client Interaction transport.\r\n * @param data Gateway interaction payload.\r\n * @returns Specialized interaction structure.\r\n * @throws {TypeError} If required identifiers are missing.\r\n */\r\nexport function createInteraction(\r\n client: InteractionClient,\r\n data: InteractionData,\r\n): Interaction {\r\n switch (data.type) {\r\n case InteractionType.ApplicationCommand:\r\n return new CommandInteraction(client, data);\r\n case InteractionType.ApplicationCommandAutocomplete:\r\n return new AutocompleteInteraction(client, data);\r\n case InteractionType.MessageComponent:\r\n return new ComponentInteraction(client, data);\r\n case InteractionType.ModalSubmit:\r\n return new ModalSubmitInteraction(client, data);\r\n default:\r\n return new Interaction(client, data);\r\n }\r\n}\r\n",
|
|
10
|
+
"import type {\r\n APIEmbed,\r\n APIEmbedAuthor,\r\n APIEmbedField,\r\n APIEmbedFooter,\r\n APIEmbedMedia,\r\n} from \"@lunibee/types\";\r\n\r\n/**\r\n * A rich Embed structure that wraps a Discord API embed object.\r\n * Provides typed accessors and a fluent builder interface.\r\n */\r\nexport class Embed {\r\n #data: APIEmbed;\r\n\r\n /** Creates an Embed from raw Discord API data, or starts a blank embed. */\r\n public constructor(data: APIEmbed = {}) {\r\n this.#data = { ...data };\r\n if (this.#data.fields) this.#data.fields = [...this.#data.fields];\r\n }\r\n\r\n // ── Read accessors ───────────────────────────────────────────────────────\r\n\r\n /** Embed title. */\r\n public get title(): string | undefined {\r\n return this.#data.title;\r\n }\r\n /** Embed description. */\r\n public get description(): string | undefined {\r\n return this.#data.description;\r\n }\r\n /** Embed URL. */\r\n public get url(): string | undefined {\r\n return this.#data.url;\r\n }\r\n /** Embed color as an integer. */\r\n public get color(): number | undefined {\r\n return this.#data.color;\r\n }\r\n /** Embed timestamp ISO 8601 string. */\r\n public get timestamp(): string | undefined {\r\n return this.#data.timestamp;\r\n }\r\n /** Embed timestamp as a Date object, or undefined. */\r\n public get createdAt(): Date | undefined {\r\n return this.#data.timestamp ? new Date(this.#data.timestamp) : undefined;\r\n }\r\n /** Embed footer. */\r\n public get footer(): APIEmbedFooter | undefined {\r\n return this.#data.footer;\r\n }\r\n /** Embed image. */\r\n public get image(): APIEmbedMedia | undefined {\r\n return this.#data.image;\r\n }\r\n /** Embed thumbnail. */\r\n public get thumbnail(): APIEmbedMedia | undefined {\r\n return this.#data.thumbnail;\r\n }\r\n /** Embed video. */\r\n public get video(): APIEmbedMedia | undefined {\r\n return this.#data.video;\r\n }\r\n /** Embed author. */\r\n public get author(): APIEmbedAuthor | undefined {\r\n return this.#data.author;\r\n }\r\n /** Embed fields (read-only copy). */\r\n public get fields(): readonly APIEmbedField[] {\r\n return this.#data.fields ?? [];\r\n }\r\n\r\n // ── Fluent builder methods ────────────────────────────────────────────────\r\n\r\n /** Sets the embed title. @param title Embed title text (max 256 chars). @throws {TypeError} If title exceeds 256 characters. */\r\n public setTitle(title: string): this {\r\n if (title.length > 256)\r\n throw new TypeError(\"Embed title must not exceed 256 characters.\");\r\n this.#data.title = title;\r\n return this;\r\n }\r\n\r\n /** Sets the embed description. @param description Embed description (max 4096 chars). @throws {TypeError} If description exceeds 4096 characters. */\r\n public setDescription(description: string): this {\r\n if (description.length > 4096)\r\n throw new TypeError(\"Embed description must not exceed 4096 characters.\");\r\n this.#data.description = description;\r\n return this;\r\n }\r\n\r\n /** Sets the embed URL. @param url A valid URL string. */\r\n public setURL(url: string): this {\r\n this.#data.url = url;\r\n return this;\r\n }\r\n\r\n /** Sets the embed color. Accepts a hex number (0xff0000), decimal integer, or hex string (\"#ff0000\"). @param color Color value. */\r\n public setColor(color: number | string): this {\r\n if (typeof color === \"string\") {\r\n const hex = color.replace(/^#/, \"\");\r\n this.#data.color = parseInt(hex, 16);\r\n } else {\r\n this.#data.color = color;\r\n }\r\n return this;\r\n }\r\n\r\n /** Sets the embed timestamp. Accepts a Date, ISO string, or number (ms since epoch). Defaults to now. */\r\n public setTimestamp(timestamp: Date | string | number = Date.now()): this {\r\n this.#data.timestamp = new Date(timestamp).toISOString();\r\n return this;\r\n }\r\n\r\n /** Sets the embed footer. @param text Footer text (max 2048 chars). @param iconURL Optional footer icon URL. */\r\n public setFooter(text: string, iconURL?: string): this {\r\n if (text.length > 2048)\r\n throw new TypeError(\"Embed footer text must not exceed 2048 characters.\");\r\n this.#data.footer = iconURL ? { text, icon_url: iconURL } : { text };\r\n return this;\r\n }\r\n\r\n /** Sets the embed image. @param url Image URL. */\r\n public setImage(url: string): this {\r\n this.#data.image = { url };\r\n return this;\r\n }\r\n\r\n /** Sets the embed thumbnail. @param url Thumbnail URL. */\r\n public setThumbnail(url: string): this {\r\n this.#data.thumbnail = { url };\r\n return this;\r\n }\r\n\r\n /** Sets the embed author. @param name Author name (max 256 chars). @param options Optional URL and icon URL. */\r\n public setAuthor(\r\n name: string,\r\n options: { url?: string; iconURL?: string } = {},\r\n ): this {\r\n if (name.length > 256)\r\n throw new TypeError(\"Embed author name must not exceed 256 characters.\");\r\n this.#data.author = {\r\n name,\r\n url: options.url,\r\n icon_url: options.iconURL,\r\n };\r\n return this;\r\n }\r\n\r\n /** Adds one or more fields to the embed. @param fields Fields to add (max 25 total). @throws {TypeError} If adding exceeds 25 fields. */\r\n public addFields(...fields: APIEmbedField[]): this {\r\n const existing = this.#data.fields ?? [];\r\n if (existing.length + fields.length > 25)\r\n throw new TypeError(\"Embeds cannot have more than 25 fields.\");\r\n for (const field of fields) {\r\n if (field.name.length > 256)\r\n throw new TypeError(\"Embed field name must not exceed 256 characters.\");\r\n if (field.value.length > 1024)\r\n throw new TypeError(\r\n \"Embed field value must not exceed 1024 characters.\",\r\n );\r\n }\r\n this.#data.fields = [...existing, ...fields];\r\n return this;\r\n }\r\n\r\n /** Removes all fields from the embed. */\r\n public clearFields(): this {\r\n this.#data.fields = [];\r\n return this;\r\n }\r\n\r\n /** Splices the fields array, replacing, inserting, or deleting fields. @param index Start index. @param deleteCount Number of fields to remove. @param fields Replacement fields. */\r\n public spliceFields(\r\n index: number,\r\n deleteCount: number,\r\n ...fields: APIEmbedField[]\r\n ): this {\r\n const next = [...(this.#data.fields ?? [])];\r\n next.splice(index, deleteCount, ...fields);\r\n if (next.length > 25)\r\n throw new TypeError(\"Embeds cannot have more than 25 fields.\");\r\n for (const field of fields) {\r\n if (field.name.length > 256)\r\n throw new TypeError(\"Embed field name must not exceed 256 characters.\");\r\n if (field.value.length > 1024)\r\n throw new TypeError(\"Embed field value must not exceed 1024 characters.\");\r\n }\r\n this.#data.fields = next;\r\n return this;\r\n }\r\n\r\n // ── Serialization ─────────────────────────────────────────────────────────\r\n\r\n /** Returns the raw Discord API embed payload. */\r\n public toJSON(): APIEmbed {\r\n const json = { ...this.#data };\r\n if (json.fields) json.fields = [...json.fields];\r\n return json;\r\n }\r\n\r\n /** Creates an Embed from an existing raw API embed object. */\r\n public static from(data: APIEmbed): Embed {\r\n return new Embed(data);\r\n }\r\n}\r\n",
|
|
11
|
+
"/** Resource structures for Discord messages and related entities. */\r\nimport { BaseStructure, Channel, User } from \"./base.js\";\r\nimport type { ResourceContext } from \"./base.js\";\r\n\r\nexport { BaseStructure, Channel, Guild, User } from \"./base.js\";\r\nexport type { ResourceContext } from \"./base.js\";\r\n\r\nexport class Message extends BaseStructure {\r\n public content: string;\r\n public author: User;\r\n public channelId: string;\r\n public readonly channel: Channel;\r\n public guildId?: string;\r\n public flags: number;\r\n /** Message creation timestamp (from timestamp field or snowflake). */\r\n public readonly timestamp: Date;\r\n public readonly attachments: import(\"@lunibee/types\").APIAttachment[];\r\n public readonly embeds: import(\"@lunibee/types\").APIEmbed[];\r\n public readonly mentions: User[];\r\n public readonly mentionRoles: string[];\r\n public pinned: boolean;\r\n public mentionEveryone: boolean;\r\n public type: number;\r\n public readonly reference?: import(\"@lunibee/types\").APIMessageReference;\r\n public readonly components: import(\"@lunibee/types\").APIMessageComponent[];\r\n public readonly referencedMessage?: Message | null;\r\n readonly #context?: ResourceContext;\r\n\r\n /** Creates a message structure from Discord message data. */\r\n public constructor(\r\n data: import(\"@lunibee/types\").APIMessage,\r\n context?: ResourceContext,\r\n ) {\r\n super(data.id);\r\n if (!/^\\d{1,20}$/.test(data.channel_id))\r\n throw new TypeError(\"Message channel_id must be a valid snowflake.\");\r\n this.content = data.content ?? \"\";\r\n this.author = new User(data.author);\r\n this.channelId = data.channel_id;\r\n this.guildId = data.guild_id;\r\n this.flags = data.flags ?? 0;\r\n this.timestamp = new Date(\r\n data.timestamp ?? Number((BigInt(this.id) >> 22n) + 1420070400000n),\r\n );\r\n this.attachments = data.attachments ?? [];\r\n this.embeds = data.embeds ?? [];\r\n this.components = data.components ?? [];\r\n this.mentions = (data.mentions ?? []).map((user) => new User(user));\r\n this.mentionRoles = data.mention_roles ?? [];\r\n this.pinned = data.pinned ?? false;\r\n this.mentionEveryone = data.mention_everyone ?? false;\r\n this.type = data.type ?? 0;\r\n this.reference = data.message_reference;\r\n this.referencedMessage = data.referenced_message\r\n ? new Message(data.referenced_message, context)\r\n : data.referenced_message === null\r\n ? null\r\n : undefined;\r\n this.#context = context;\r\n this.channel = new Channel(\r\n { id: data.channel_id, type: 0, guild_id: data.guild_id },\r\n context,\r\n );\r\n }\r\n\r\n /** Whether embeds are suppressed on this message. */\r\n public get embedsSuppressed(): boolean {\r\n return (this.flags & 4) !== 0;\r\n }\r\n\r\n /** Edits this message. @param options Message fields to change. @returns The updated message. @throws {Error} If the message is not attached to a client. */\r\n public edit(\r\n options: Record<string, unknown> & { content?: string },\r\n ): Promise<Message> {\r\n if (!this.#context)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.editMessage(this.channelId, this.id, options);\r\n }\r\n\r\n /** Updates this message using the same resource operation as edit. @param options Message fields to change. @returns The updated message. @throws {Error} If the message is not attached to a client. */\r\n public update(\r\n options: Record<string, unknown> & { content?: string },\r\n ): Promise<Message> {\r\n return this.edit(options);\r\n }\r\n\r\n /** Deletes this message. @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the message is not attached to a client. */\r\n public delete(): Promise<void> {\r\n if (!this.#context)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.deleteMessage(this.channelId, this.id);\r\n }\r\n\r\n /** Replies to this message. @param options Message content or payload. @returns The created reply message. @throws {Error} If the message is not attached to a client. */\r\n public reply(\r\n options: string | (Record<string, unknown> & { content?: string }),\r\n ): Promise<Message> {\r\n if (!this.#context)\r\n throw new Error(\"This message is not attached to a client.\");\r\n const payload =\r\n typeof options === \"string\" ? { content: options } : { ...options };\r\n payload.message_reference = {\r\n message_id: this.id,\r\n channel_id: this.channelId,\r\n guild_id: this.guildId,\r\n };\r\n return this.#context.sendMessage(this.channelId, payload);\r\n }\r\n\r\n /** Crossposts this message. @returns The resulting message. @throws {Error} If the message is not attached to a client. */\r\n public crosspost(): Promise<Message> {\r\n if (!this.#context)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.crosspostMessage(this.channelId, this.id);\r\n }\r\n\r\n /** Adds a reaction to this message. @param emoji Emoji identifier. @returns A promise fulfilled when the reaction is added. @throws {Error} If reactions are unavailable. */\r\n public react(emoji: string): Promise<void> {\r\n if (!this.#context?.addReaction)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.addReaction(this.channelId, this.id, emoji);\r\n }\r\n\r\n /** Removes a reaction from this message. @param emoji Emoji identifier. @param userId User whose reaction should be removed; omit to remove the current user's reaction. @returns A promise fulfilled when the reaction is removed. @throws {Error} If reaction operations are unavailable. */\r\n public removeReaction(emoji: string, userId?: string): Promise<void> {\r\n if (!this.#context)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return userId\r\n ? (this.#context.removeReaction?.(\r\n this.channelId,\r\n this.id,\r\n emoji,\r\n userId,\r\n ) ?? Promise.reject(new Error(\"Reaction operations are unavailable.\")))\r\n : (this.#context.removeOwnReaction?.(this.channelId, this.id, emoji) ??\r\n Promise.reject(new Error(\"Reaction operations are unavailable.\")));\r\n }\r\n\r\n /** Removes all reactions from this message. @returns A promise fulfilled when reactions are removed. @throws {Error} If reaction operations are unavailable. */\r\n public removeAllReactions(): Promise<void> {\r\n if (!this.#context?.removeAllReactions)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.removeAllReactions(this.channelId, this.id);\r\n }\r\n\r\n /** Pins this message. @returns A promise fulfilled when the message is pinned. @throws {Error} If pin operations are unavailable. */\r\n public pin(): Promise<void> {\r\n if (!this.#context?.pinMessage)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.pinMessage(this.channelId, this.id);\r\n }\r\n\r\n /** Unpins this message. @returns A promise fulfilled when the message is unpinned. @throws {Error} If pin operations are unavailable. */\r\n public unpin(): Promise<void> {\r\n if (!this.#context?.unpinMessage)\r\n throw new Error(\"This message is not attached to a client.\");\r\n return this.#context.unpinMessage(this.channelId, this.id);\r\n }\r\n}\r\n\r\nexport { GuildMember, Role, TextChannel } from \"./resources.js\";\r\nexport * from \"./interactions.js\";\r\nexport { Embed } from \"./embed.js\";\r\n"
|
|
10
12
|
],
|
|
11
|
-
"mappings": ";;AACO,MAAM,cAAc;AAAA,EAET;AAAA,EAET,WAAW,CAAC,IAAY;AAAA,IAC7B,IAAI,CAAC,aAAa,KAAK,EAAE;AAAA,MACvB,MAAM,IAAI,UAAU,oDAAoD;AAAA,IAC1E,KAAK,KAAK;AAAA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