diff --git a/src/structures/CommandInteraction.js b/src/structures/CommandInteraction.js index d79dea06aec3..095ef871b2a8 100644 --- a/src/structures/CommandInteraction.js +++ b/src/structures/CommandInteraction.js @@ -261,6 +261,7 @@ class CommandInteraction extends Interaction { */ _createOptionsCollection(options, resolved) { const optionsCollection = new Collection(); + if (typeof options === 'undefined') return optionsCollection; for (const option of options) { optionsCollection.set(option.name, this.transformOption(option, resolved)); } diff --git a/typings/index.d.ts b/typings/index.d.ts index 84367a85c69f..7f781319c8e3 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1184,9 +1184,7 @@ declare module 'discord.js' { options?: ReactionCollectorOptions, ): ReactionCollector; public delete(): Promise; - public edit( - content: string | null | MessageEditOptions | MessageEmbed | APIMessage, - ): Promise; + public edit(content: string | null | MessageEditOptions | MessageEmbed | APIMessage): Promise; public edit(content: string | null, options: MessageEditOptions | MessageEmbed): Promise; public equals(message: Message, rawData: unknown): boolean; public fetchReference(): Promise; @@ -1971,9 +1969,7 @@ declare module 'discord.js' { ): Promise; public editMessage(message: MessageResolvable, options: WebhookEditMessageOptions): Promise; public fetchMessage(message: Snowflake, cache?: boolean): Promise; - public send( - content: string | (WebhookMessageOptions & { split?: false }) | MessageAdditions, - ): Promise; + public send(content: string | (WebhookMessageOptions & { split?: false }) | MessageAdditions): Promise; public send(options: WebhookMessageOptions & { split: true | SplitOptions }): Promise; public send(options: WebhookMessageOptions | APIMessage): Promise; public send( @@ -2761,7 +2757,7 @@ declare module 'discord.js' { name: string; type: ApplicationCommandOptionType; value?: string | number | boolean; - options?: CommandInteractionOption[]; + options?: Collection; user?: User; member?: GuildMember | RawInteractionDataResolvedGuildMember; channel?: GuildChannel | RawInteractionDataResolvedChannel;