From ef04d6eec94fff4956328288e291d252182dbf22 Mon Sep 17 00:00:00 2001 From: Cat++ <69035887+NotGhex@users.noreply.github.com> Date: Thu, 9 May 2024 17:31:10 +0800 Subject: [PATCH] did I fixed it? --- .../classes/builders/SlashCommandBuilder.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/core/src/classes/builders/SlashCommandBuilder.ts b/packages/core/src/classes/builders/SlashCommandBuilder.ts index 9fc813f0..5b98871f 100644 --- a/packages/core/src/classes/builders/SlashCommandBuilder.ts +++ b/packages/core/src/classes/builders/SlashCommandBuilder.ts @@ -1,10 +1,10 @@ -import { ApplicationCommandType, Awaitable, ChatInputCommandInteraction, isJSONEncodable, JSONEncodable, SlashCommandBuilder as DiscordJsSlashCommandBuilder, SharedSlashCommandOptions, RESTPostAPIChatInputApplicationCommandsJSONBody, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandBuilder, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandUserOption, ApplicationCommandOptionType, ApplicationCommandOptionAllowedChannelTypes, PermissionResolvable, PermissionsBitField } from 'discord.js'; +import { Awaitable, ChatInputCommandInteraction, JSONEncodable, SlashCommandBuilder as DiscordJsSlashCommandBuilder, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, SharedSlashCommandOptions, ApplicationCommandOptionType, SlashCommandStringOption, SlashCommandIntegerOption, SlashCommandBooleanOption, SlashCommandUserOption, SlashCommandChannelOption, ApplicationCommandOptionAllowedChannelTypes, SlashCommandRoleOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandAttachmentOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, isJSONEncodable, PermissionsBitField, PermissionResolvable } from 'discord.js'; import { AnyNonSubcommandSlashCommandOptionBuilder, AnySlashCommandOptionBuilder, AnySlashCommandOptionData, CommandHaltData } from '../../types/structures'; import { BaseCommandBuilder, BaseCommandBuilderData } from './BaseCommandBuilder'; import { CommandHaltReason, CommandType } from '../../types/constants'; import { RecipleClient } from '../structures/RecipleClient'; -import { CooldownData } from '../structures/Cooldown'; import { Mixin } from 'ts-mixer'; +import { CooldownData } from '../structures/Cooldown'; export interface SlashCommandExecuteData { type: CommandType.SlashCommand; @@ -37,30 +37,30 @@ export interface SlashCommandBuilder extends DiscordJsSlashCommandBuilder, BaseC addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder|((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): Omit; addSubcommand(input: SlashCommandSubcommandBuilder|((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): Omit; - addBooleanOption(input: SlashCommandBooleanOption|((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): Omit; - addUserOption(input: SlashCommandUserOption|((builder: SlashCommandUserOption) => SlashCommandUserOption)): Omit; - addChannelOption(input: SlashCommandChannelOption|((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): Omit; - addRoleOption(input: SlashCommandRoleOption|((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): Omit; - addAttachmentOption(input: SlashCommandAttachmentOption|((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): Omit; - addMentionableOption(input: SlashCommandMentionableOption|((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): Omit; + addBooleanOption(input: SlashCommandBooleanOption|((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): SharedSlashCommandOptions & Omit; + addUserOption(input: SlashCommandUserOption|((builder: SlashCommandUserOption) => SlashCommandUserOption)): SharedSlashCommandOptions & Omit; + addChannelOption(input: SlashCommandChannelOption|((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): SharedSlashCommandOptions & Omit; + addRoleOption(input: SlashCommandRoleOption|((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): SharedSlashCommandOptions & Omit; + addAttachmentOption(input: SlashCommandAttachmentOption|((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): SharedSlashCommandOptions & Omit; + addMentionableOption(input: SlashCommandMentionableOption|((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): SharedSlashCommandOptions & Omit; addStringOption(input: | SlashCommandStringOption | Omit | Omit | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit | Omit) - ): Omit; + ): SharedSlashCommandOptions & Omit; addIntegerOption(input: | SlashCommandIntegerOption | Omit | Omit | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit | Omit) - ): Omit; + ): SharedSlashCommandOptions & Omit; addNumberOption(input: | SlashCommandNumberOption | Omit | Omit | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit | Omit) - ): Omit; + ): SharedSlashCommandOptions & Omit; } export class SlashCommandBuilder extends Mixin(DiscordJsSlashCommandBuilder, BaseCommandBuilder) { @@ -105,7 +105,7 @@ export class SlashCommandBuilder extends Mixin(DiscordJsSlashCommandBuilder, Bas } } - public static addOption(builder: Builder, option: AnySlashCommandOptionBuilder): Builder { + public static addOption>(builder: Builder, option: AnySlashCommandOptionBuilder): Builder { if (option instanceof SlashCommandAttachmentOption) { builder.addAttachmentOption(option); } else if (option instanceof SlashCommandBooleanOption) {