export * from '@discordx/di'; import { Decorator, ClassMethodDecorator, MethodDecoratorEx, ClassDecoratorEx, ParameterDecoratorEx, Modifier } from '@discordx/internal'; export * from '@discordx/internal'; import { Client as Client$1, Snowflake, Interaction, Message, MessageReaction, PartialMessageReaction, User, PartialUser, ApplicationCommand, PermissionResolvable, InteractionContextType, ApplicationIntegrationType, LocalizationMap, ApplicationCommandType, ChatInputCommandInteraction, ChannelType, ApplicationCommandOptionType, ApplicationCommandOptionData, ClientOptions as ClientOptions$1, ClientEvents, RestEvents, ThreadChannel, GuildChannel, GuildMember, Role, AutocompleteInteraction, Attachment, Channel, APIRole, APIInteractionDataResolvedGuildMember, SlashCommandBuilder, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandUserOption, ButtonInteraction, ModalSubmitInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction } from 'discord.js'; /** * Extended Discord.js client with discordx functionality * * @param options - Client options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/basics/client) */ declare class Client extends Client$1 { private _botId; private _isBuilt; private _prefix; private _simpleCommandConfig?; private _silent; private _botGuilds; private _guards; logger: ILogger; applicationCommandManager: ApplicationCommandManager; interactionHandler: InteractionHandler; simpleCommandManager: SimpleCommandManager; reactionManager: ReactionManager; debugManager: DebugManager; get botId(): string; set botId(value: string); get silent(): boolean; set silent(value: boolean); get guards(): GuardFunction[]; set guards(value: GuardFunction[]); get prefix(): IPrefixResolver; set prefix(value: IPrefixResolver); get simpleCommandConfig(): SimpleCommandConfig | undefined; set simpleCommandConfig(value: SimpleCommandConfig | undefined); get botGuilds(): IGuild[]; set botGuilds(value: IGuild[]); get botResolvedGuilds(): Promise; get instance(): MetadataStorage; static get applicationCommands(): readonly DApplicationCommand[]; static get applicationCommandSlashes(): readonly DApplicationCommand[]; static get applicationCommandSlashesFlat(): readonly DApplicationCommand[]; static get applicationCommandSlashOptions(): readonly DApplicationCommandOption[]; static get applicationCommandSlashGroups(): readonly DApplicationCommandGroup[]; static get applicationCommandSlashSubGroups(): readonly DApplicationCommandGroup[]; static get applicationCommandUsers(): readonly DApplicationCommand[]; static get applicationCommandMessages(): readonly DApplicationCommand[]; static get events(): readonly DOn[]; static get discords(): readonly DDiscord[]; static get buttonComponents(): readonly DComponent[]; static get modalComponents(): readonly DComponent[]; static get selectMenuComponents(): readonly DComponent[]; static get reactions(): readonly DReaction[]; static get simpleCommands(): readonly DSimpleCommand[]; static get simpleCommandsByName(): readonly ISimpleCommandByName[]; static get simpleCommandMappedPrefix(): readonly string[]; static get instance(): MetadataStorage; get applicationCommands(): readonly DApplicationCommand[]; get applicationCommandSlashes(): readonly DApplicationCommand[]; get applicationCommandSlashesFlat(): readonly DApplicationCommand[]; get applicationCommandSlashOptions(): readonly DApplicationCommandOption[]; get applicationCommandSlashGroups(): readonly DApplicationCommandGroup[]; get applicationCommandSlashSubGroups(): readonly DApplicationCommandGroup[]; get applicationCommandUsers(): readonly DApplicationCommand[]; get applicationCommandMessages(): readonly DApplicationCommand[]; get events(): readonly DOn[]; get discords(): readonly DDiscord[]; get buttonComponents(): readonly DComponent[]; get modalComponents(): readonly DComponent[]; get selectMenuComponents(): readonly DComponent[]; get reactions(): readonly DReaction[]; get simpleCommands(): readonly DSimpleCommand[]; get simpleCommandsByName(): readonly ISimpleCommandByName[]; get simpleCommandMappedPrefix(): readonly string[]; constructor(options: ClientOptions); /** * Start bot */ login(token: string): Promise; /** * Build the client and initialize all systems */ build(): Promise; initApplicationCommands(retainDeleted?: boolean): Promise; clearApplicationCommands(...guilds: Snowflake[]): Promise; executeInteraction(interaction: Interaction): Awaited; parseCommand(message: Message, caseSensitive?: boolean): Promise; executeCommand(message: Message, caseSensitive?: boolean): Promise; executeReaction(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser): Promise; trigger(options: EventConfig, params: any): Promise; /** * Bind discordx events to client */ initEvents(): void; /** * Unbind all discordx events initialized by the initEvents method. */ removeEvents(): void; printDebug(): void; } declare class ApplicationCommandMixin { command: ApplicationCommand; instance: DApplicationCommand; constructor(command: ApplicationCommand, instance: DApplicationCommand); get name(): string; get description(): string; } /** * Simple command message */ declare class SimpleCommandMessage { prefix: string; argString: string; message: Message; info: DSimpleCommand; splitter?: ArgSplitter | undefined; options: SimpleOptionType[]; constructor(prefix: string, argString: string, message: Message, info: DSimpleCommand, splitter?: ArgSplitter | undefined); get name(): string; get description(): string; /** * Resolve options */ resolveOptions(): Promise; /** * Verify that all options are valid * * @returns */ isValid(): boolean; /** * Get related commands * * @returns */ getRelatedCommands(): DSimpleCommand[]; /** * Send usage syntax for command * * @returns */ sendUsageSyntax(): Promise; } /** * Base class for method decorators that can be executed with guard middleware. * * @category Decorator */ declare abstract class Method extends Decorator { protected _discord: DDiscord; protected _guards: DGuard[]; get discord(): DDiscord; set discord(value: DDiscord); /** * Creates an executable function that runs all guards followed by the main method. * * The execution flow follows this pattern: * ```typescript * async (params, client) => { * await guard1(params, client, next, sharedData) * await guard2(params, client, next, sharedData) * await guard3(params, client, next, sharedData) * await mainMethod(parsedParams, params, client, sharedData) * } * ``` * * @returns Function that executes the complete guard chain */ get execute(): (guards: GuardFunction[], ...params: unknown[]) => Promise; /** * Gets all guards that will be executed for this method. * * Combines guards in this order: * 1. Global guards from the Discord client * 2. Class-level guards from @Discord decorator * 3. Method-specific guards from this method * 4. The main method itself (as the final "guard") */ get guards(): DGuard[]; set guards(value: DGuard[]); /** * Parses the raw execution parameters into the format expected by the method. * Must be implemented by subclasses to handle their specific parameter types. * * @param params - Raw execution parameters (e.g., Discord interaction, client) * @returns Parsed parameters ready for method execution */ abstract parseParams(...params: unknown[]): Awaitable; /** * Creates a guard execution chain that processes guards sequentially. * * Each guard receives: * - Original parameters (interaction, client, etc.) * - Next function to continue the chain * - Shared data object for passing data between guards * * The final method receives: * - Parsed parameters (command options, etc.) * - Original parameters (interaction, client, etc.) * - Shared data object * * @param globalGuards - Guards to prepend to the execution chain * @returns Function that executes the complete guard chain */ private createGuardChain; } interface CreateStructure$7 { botIds?: string[]; contexts?: InteractionContextType[] | null; defaultMemberPermissions?: PermissionResolvable | string | null; description: string; descriptionLocalizations?: LocalizationMap | null; dmPermission?: boolean; guilds?: IGuild[]; integrationTypes?: ApplicationIntegrationType[]; name: string; nameLocalizations?: LocalizationMap | null; nsfw?: boolean; type: ApplicationCommandType; } /** * @category Decorator */ declare class DApplicationCommand extends Method { private _botIds; private _contexts; private _defaultMemberPermissions; private _description; private _descriptionLocalizations; private _dmPermission; private _group?; private _guilds; private _integrationTypes; private _name; private _nameLocalizations; private _nsfw; private _options; private _subgroup?; private _type; get botIds(): string[]; set botIds(value: string[]); get description(): string; set description(value: string); get defaultMemberPermissions(): PermissionResolvable | string | null; set defaultMemberPermissions(value: PermissionResolvable | string | null); get dmPermission(): boolean; set dmPermission(value: boolean); get contexts(): InteractionContextType[] | null; set contexts(value: InteractionContextType[] | null); get integrationTypes(): ApplicationIntegrationType[]; set integrationTypes(value: ApplicationIntegrationType[]); get descriptionLocalizations(): LocalizationMap | null; set descriptionLocalizations(value: LocalizationMap | null); get group(): string | undefined; set group(value: string | undefined); get guilds(): IGuild[]; set guilds(value: IGuild[]); get name(): string; set name(value: string); get nameLocalizations(): LocalizationMap | null; set nameLocalizations(value: LocalizationMap | null); get nsfw(): boolean; set nsfw(value: boolean); get options(): DApplicationCommandOption[]; set options(value: DApplicationCommandOption[]); get subgroup(): string | undefined; set subgroup(value: string | undefined); get type(): ApplicationCommandType; set type(value: ApplicationCommandType); constructor(data: CreateStructure$7); static create(data: CreateStructure$7): DApplicationCommand; isBotAllowed(botId: string): boolean; getGuilds(client: Client): Promise; isGuildAllowed(client: Client, guildId: string | null): Promise; toSubCommand(): DApplicationCommandOption; toJSON(): ApplicationCommandDataEx; parseParams(interaction: ChatInputCommandInteraction): Promise; } interface CreateStructure$6 { name: string; payload: Partial; root?: string; } /** * @category Decorator */ declare class DApplicationCommandGroup extends Decorator { name: string; root?: string; payload: Partial; constructor(options: CreateStructure$6); static create(options: CreateStructure$6): DApplicationCommandGroup; } interface CreateStructure$5 { autocomplete?: SlashAutoCompleteOption; channelType?: ChannelType[]; choices?: DApplicationCommandOptionChoice[]; description: string; descriptionLocalizations?: LocalizationMap | null; index?: number; maxLength?: number; maxValue?: number; minLength?: number; minValue?: number; name: string; nameLocalizations?: LocalizationMap | null; required?: boolean; transformer?: TransformerFunction; type: ApplicationCommandOptionType; } /** * @category Decorator */ declare class DApplicationCommandOption extends Decorator { private _autocomplete; private _channelTypes; private _choices; private _description; private _descriptionLocalizations; private _name; private _nameLocalizations; private _maxValue?; private _minValue?; private _maxLength?; private _minLength?; private _options; private _required; private _type; private _transformer?; get autocomplete(): SlashAutoCompleteOption; set autocomplete(value: SlashAutoCompleteOption); get channelTypes(): ChannelType[] | undefined; set channelTypes(value: ChannelType[] | undefined); get choices(): DApplicationCommandOptionChoice[]; set choices(value: DApplicationCommandOptionChoice[]); get description(): string; set description(value: string); get descriptionLocalizations(): LocalizationMap | null; set descriptionLocalizations(value: LocalizationMap | null); get isNode(): boolean; get maxValue(): number | undefined; set maxValue(value: number | undefined); get minValue(): number | undefined; set minValue(value: number | undefined); get maxLength(): number | undefined; set maxLength(value: number | undefined); get minLength(): number | undefined; set minLength(value: number | undefined); get name(): string; set name(value: string); get nameLocalizations(): LocalizationMap | null; set nameLocalizations(value: LocalizationMap | null); get options(): DApplicationCommandOption[]; set options(value: DApplicationCommandOption[]); get required(): boolean; set required(value: boolean); get type(): ApplicationCommandOptionType; set type(value: ApplicationCommandOptionType); constructor(data: CreateStructure$5); static create(data: CreateStructure$5): DApplicationCommandOption; toJSON(): ApplicationCommandOptionData; parseType(interaction: ChatInputCommandInteraction): unknown; parse(interaction: ChatInputCommandInteraction): Awaitable; } interface SimpleCommandConfig { /** * Global argument splitter for simple command */ argSplitter?: ArgSplitter; /** * bot prefix or prefix resolver */ prefix?: IPrefixResolver; /** * Define global response for certain conditions */ responses?: { /** * Define response for not found command */ notFound?: string | ((command: Message) => Awaitable); }; } interface ClientOptions extends ClientOptions$1 { /** * Set the guilds globally for application commands */ botGuilds?: IGuild[]; /** * Specify bot id (added for multiple bot support) */ botId?: string; /** * The global guards */ guards?: GuardFunction[]; /** * Set custom logger implementation */ logger?: ILogger; /** * Do not log anything */ silent?: boolean; /** * simple command related customization */ simpleCommand?: SimpleCommandConfig; } type Awaitable = Promise | T; type TransformerFunction = (value: any, interaction: ChatInputCommandInteraction) => Awaitable; type Next = (...paramsToNext: unknown[]) => Promise; type IPrefix = string | string[]; type IPrefixResolver = string | string[] | ((message: Message) => Awaitable); type IGuild = Snowflake | Snowflake[] | ((client: Client, command: DApplicationCommand | DComponent | DReaction | SimpleCommandMessage | undefined) => Snowflake | Snowflake[] | Promise | Promise); interface ISimpleCommandByName { command: DSimpleCommand; name: string; } declare const SpecialCharactersList: readonly ["~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "+", "=", "{", "}", "[", "]", "|", "\\", "/", ":", ";", "\"", "'", "<", ">", ",", ".", "?", " "]; type SpecialCharacters = (typeof SpecialCharactersList)[number]; type ForbidCharacter = S extends `${string}${Character}${string}` ? never : S; type WhitelistWords = S extends "" ? unknown : S extends `${D}${infer Tail}` ? WhitelistWords : never; type TruncateTo32 = T extends "" ? unknown : T extends `${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}${infer R}` ? T extends `${infer F}${R}` ? F : never : T; type NotEmptyCheck = T extends "" ? never : T; type NotEmpty = NotEmptyCheck extends never ? "A string of zero length is not allowed" : T; type VName = NotEmptyCheck & Lowercase & TruncateTo32 & ForbidCharacter; type VerifyName = T extends VName ? T : VName extends never ? "Name must only be lowercase with no space as per Discord guidelines" : VName; /** * Type the arguments of an event * ___ * [View Documentation](https://discordx.js.org/docs/discordx/basics/args-of) */ type ArgsOf = ClientEvents[K]; /** * Type the arguments of an event * ___ * [View Documentation](https://discordx.js.org/docs/discordx/basics/rest-args-of) */ type RestArgsOf = RestEvents[K]; /** * Event options */ interface EventOptions { botIds?: string[]; event: keyof ClientEvents; priority?: number; } /** * Rest event options */ interface RestEventOptions { botIds?: string[]; event: keyof RestEvents; priority?: number; } /** * Guard function */ type GuardFunction = (params: Type, client: Client, next: Next, data: DataType) => any; /** * Custom logger */ interface ILogger { error(...args: unknown[]): void; info(...args: unknown[]): void; log(...args: unknown[]): void; warn(...args: unknown[]): void; } /** * Reaction options */ interface ReactionOptions { aliases?: string[]; botIds?: string[]; description?: string; directMessage?: boolean; emoji: NotEmpty; guilds?: IGuild[]; partial?: boolean; remove?: boolean; } /** * Slash choice type */ interface SlashChoiceType { name: NotEmpty; nameLocalizations?: LocalizationMap; value?: X; } /** * Component type */ interface ComponentOptions { botIds?: string[]; guilds?: IGuild[]; id?: NotEmpty | RegExp; } /** * Component type enum */ declare enum ComponentType { Button = 0, SelectMenu = 1, Modal = 2 } /** * Component type enum */ declare enum SimpleCommandParseType { notCommand = 0, notFound = 1 } type ArgSplitter = string | RegExp | ((command: SimpleCommandMessage) => string[]); interface SimpleCommandOptions { aliases?: string[]; argSplitter?: ArgSplitter; botIds?: string[]; description?: string; directMessage?: boolean; guilds?: IGuild[]; name?: NotEmpty; prefix?: IPrefix; } interface SimpleCommandOptionOptions { description?: string; name: NotEmpty; type: SimpleCommandOptionType; } type SimpleOptionType = string | number | boolean | ThreadChannel | GuildChannel | User | GuildMember | Role | null; declare enum SimpleCommandOptionType { String = 0, Number = 1, Boolean = 2, User = 3, Channel = 4, Role = 5, Mentionable = 6 } interface ApplicationCommandOptions { botIds?: string[]; contexts?: InteractionContextType[]; defaultMemberPermissions?: PermissionResolvable; description: TD; descriptionLocalizations?: LocalizationMap; dmPermission?: boolean; guilds?: IGuild[]; integrationTypes?: ApplicationIntegrationType[]; name?: T; nameLocalizations?: LocalizationMap; nsfw?: boolean; } interface SlashOptionBaseOptions { autocomplete?: undefined; channelTypes?: undefined; description: TD; descriptionLocalizations?: LocalizationMap; maxLength?: undefined; maxValue?: undefined; minLength?: undefined; minValue?: undefined; name: T; nameLocalizations?: LocalizationMap; nsfw?: boolean; required?: boolean; type: Exclude; } type SlashOptionChannelOptions = Omit, "channelTypes" | "type"> & { channelTypes?: ChannelType[]; type: ApplicationCommandOptionType.Channel; }; type SlashOptionAutoCompleteOptions = Omit, "autocomplete" | "type"> & { autocomplete?: SlashAutoCompleteOption; type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer; }; type SlashOptionNumberOptions = Omit, "maxValue" | "minValue" | "autocomplete" | "type"> & { autocomplete?: SlashAutoCompleteOption; maxValue?: number; minValue?: number; type: ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer; }; type SlashOptionStringOptions = Omit, "maxLength" | "minLength" | "autocomplete" | "type"> & { autocomplete?: SlashAutoCompleteOption; maxLength?: number; minLength?: number; type: ApplicationCommandOptionType.String; }; type SlashOptionOptions = SlashOptionBaseOptions | SlashOptionChannelOptions | SlashOptionNumberOptions | SlashOptionStringOptions | SlashOptionAutoCompleteOptions; type SlashAutoCompleteOption = undefined | boolean | ((interaction: AutocompleteInteraction, command: DApplicationCommand) => void | Promise); interface ApplicationCommandDataEx { contexts: InteractionContextType[] | null; defaultMemberPermissions?: PermissionResolvable | string | null; description?: string; descriptionLocalizations?: LocalizationMap | null; dmPermission?: boolean; integrationTypes: ApplicationIntegrationType[]; name: string; nameLocalizations?: LocalizationMap | null; nsfw?: boolean; options: ApplicationCommandOptionData[]; type: ApplicationCommandType; } interface ApplicationCommandOptionChoiceDataEx { name: string; nameLocalizations?: LocalizationMap | null; value: string | number; } /** * Slash group options */ interface SlashGroupBase { description: TD; descriptionLocalizations?: LocalizationMap; name: T; nameLocalizations?: LocalizationMap; } type SlashGroupRoot = SlashGroupBase & { contexts?: InteractionContextType[]; defaultMemberPermissions?: PermissionResolvable; dmPermission?: boolean; integrationTypes?: ApplicationIntegrationType[]; root?: undefined; }; type SlashGroupSubRoot = SlashGroupBase & { contexts?: undefined; defaultMemberPermissions?: undefined; dmPermission?: undefined; integrationTypes?: undefined; root?: TR; }; type SlashGroupOptions = SlashGroupRoot | SlashGroupSubRoot; type SlashOptionResult = { [ApplicationCommandOptionType.Attachment]: Attachment; [ApplicationCommandOptionType.Channel]: Channel; [ApplicationCommandOptionType.String]: string; [ApplicationCommandOptionType.Boolean]: boolean; [ApplicationCommandOptionType.Integer]: number; [ApplicationCommandOptionType.Number]: number; [ApplicationCommandOptionType.Mentionable]: User | Role | GuildMember | APIRole | APIInteractionDataResolvedGuildMember; [ApplicationCommandOptionType.Role]: Role | APIRole; [ApplicationCommandOptionType.User]: GuildMember | APIInteractionDataResolvedGuildMember | User; }; /** * @category Decorator */ declare class DApplicationCommandOptionChoice extends Decorator { private _name; private _nameLocalizations; private _value; get name(): string; set name(value: string); get nameLocalizations(): LocalizationMap | null; set nameLocalizations(value: LocalizationMap | null); get value(): string | number; set value(value: string | number); constructor(data: SlashChoiceType); static create(data: SlashChoiceType): DApplicationCommandOptionChoice; toJSON(): ApplicationCommandOptionChoiceDataEx; } interface CreateStructure$4 { botIds?: string[]; guilds?: IGuild[]; id: string | RegExp; type: ComponentType; } /** * @category Decorator */ declare class DComponent extends Method { private _type; private _id; private _guilds; private _botIds; get type(): ComponentType; get botIds(): string[]; set botIds(value: string[]); get id(): string | RegExp; set id(value: string | RegExp); get guilds(): IGuild[]; set guilds(value: IGuild[]); constructor(data: CreateStructure$4); static create(data: CreateStructure$4): DComponent; isBotAllowed(botId: string): boolean; getGuilds(client: Client): Promise; isGuildAllowed(client: Client, guildId: string | null): Promise; isId(text: string): boolean; parseParams(): never[]; } /** * @category Decorator */ declare class DDiscord extends Decorator { private _applicationCommands; private _botIds; private _buttonComponents; private _description; private _events; private _guards; private _guilds; private _modalComponents; private _name; private _reactions; private _selectMenuComponents; private _simpleCommands; get applicationCommands(): DApplicationCommand[]; set applicationCommands(value: DApplicationCommand[]); get botIds(): string[]; set botIds(value: string[]); get buttons(): DComponent[]; set buttons(value: DComponent[]); get description(): string; set description(value: string); get events(): DOn[]; set events(value: DOn[]); get guards(): DGuard[]; set guards(value: DGuard[]); get guilds(): IGuild[]; set guilds(value: IGuild[]); get instance(): unknown; get modal(): DComponent[]; set modal(value: DComponent[]); get name(): string; set name(value: string); get reactions(): DReaction[]; set reactions(value: DReaction[]); get selectMenus(): DComponent[]; set selectMenus(value: DComponent[]); get simpleCommands(): DSimpleCommand[]; set simpleCommands(value: DSimpleCommand[]); constructor(name: string, description?: string); static create(name: string, description?: string): DDiscord; } /** * @category Decorator */ declare class DGuard extends Decorator { protected _fn: GuardFunction; get fn(): GuardFunction; constructor(fn: GuardFunction); static create(fn: GuardFunction): DGuard; } interface CreateStructure$3 { botIds?: string[]; event: string; once: boolean; priority?: number; rest: boolean; } /** * @category Decorator */ declare class DOn extends Method { protected _event: string; protected _once: boolean; protected _rest: boolean; protected _priority: number; protected _botIds: string[]; get botIds(): string[]; set botIds(value: string[]); get event(): string; set event(value: string); get once(): boolean; set once(value: boolean); get priority(): number; set priority(value: number); get rest(): boolean; set rest(value: boolean); constructor(data: CreateStructure$3); static create(data: CreateStructure$3): DOn; isBotAllowed(botId: string): boolean; parseParams(): never[]; } interface CreateStructure$2 { aliases?: string[]; botIds?: string[]; description?: string; directMessage?: boolean; emoji: string; guilds?: IGuild[]; partial?: boolean; remove?: boolean; } /** * @category Decorator */ declare class DReaction extends Method { private _emoji; private _description; private _directMessage; private _guilds; private _botIds; private _aliases; private _remove; private _partial; get aliases(): string[]; set aliases(value: string[]); get botIds(): string[]; set botIds(value: string[]); get guilds(): IGuild[]; set guilds(value: IGuild[]); get directMessage(): boolean; set directMessage(value: boolean); get emoji(): string; set emoji(value: string); get description(): string; set description(value: string); get remove(): boolean; set remove(value: boolean); get partial(): boolean; set partial(value: boolean); constructor(data: CreateStructure$2); static create(data: CreateStructure$2): DReaction; isBotAllowed(botId: string): boolean; getGuilds(client: Client): Promise; isGuildAllowed(client: Client, guildId: string | null): Promise; parseParams(): never[]; } interface CreateStructure$1 { aliases?: string[]; argSplitter?: ArgSplitter; botIds?: string[]; description?: string; directMessage?: boolean; guilds?: IGuild[]; name: string; prefix?: IPrefix; } /** * @category Decorator */ declare class DSimpleCommand extends Method { private _description; private _name; private _prefix; private _directMessage; private _argSplitter?; private _options; private _guilds; private _botIds; private _aliases; get aliases(): string[]; set aliases(value: string[]); get botIds(): string[]; set botIds(value: string[]); get prefix(): IPrefix | undefined; set prefix(value: IPrefix | undefined); get guilds(): IGuild[]; set guilds(value: IGuild[]); get argSplitter(): ArgSplitter | undefined; set argSplitter(value: ArgSplitter | undefined); get directMessage(): boolean; set directMessage(value: boolean); get name(): string; set name(value: string); get description(): string; set description(value: string); get options(): DSimpleCommandOption[]; set options(value: DSimpleCommandOption[]); constructor(data: CreateStructure$1); static create(data: CreateStructure$1): DSimpleCommand; isBotAllowed(botId: string): boolean; getGuilds(client: Client, command: SimpleCommandMessage): Promise; isGuildAllowed(client: Client, command: SimpleCommandMessage, guildId: string | null): Promise; parseParams(command: SimpleCommandMessage): SimpleOptionType[]; parseParamsEx(command: SimpleCommandMessage): Promise; } interface CreateStructure { description?: string; name: string; type?: SimpleCommandOptionType; } /** * @category Decorator */ declare class DSimpleCommandOption extends Decorator { private _name; private _description; private _type; get name(): string; set name(value: string); get type(): SimpleCommandOptionType; set type(value: SimpleCommandOptionType); get description(): string; set description(value: string); constructor(data: CreateStructure); static create(data: CreateStructure): DSimpleCommandOption; } /** * Execute your application button, event, select menu, simple command, slash by defined bot * when multiple bots are running simultaneously * * @param botId - Bot identifier * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/bot) * * @category Decorator */ declare function Bot(botId: NotEmpty): ClassMethodDecorator; /** * Execute your application button, event, select menu, simple command, slash by defined bot * when multiple bots are running simultaneously * * @param botIds - Multiple bot identifiers * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/bot) * * @category Decorator */ declare function Bot(...botIds: string[]): ClassMethodDecorator; /** * Interact with buttons with a defined identifier * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/button-component) * * @category Decorator */ declare function ButtonComponent(): MethodDecoratorEx; /** * Interact with buttons with a defined identifier * * @param options - Component options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/button-component) * * @category Decorator */ declare function ButtonComponent(options: ComponentOptions): MethodDecoratorEx; /** * Interact with context menu with a defined identifier * * @param options - Application command options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/context-menu) * * @category Decorator */ declare function ContextMenu(options: Omit, never> & { type: Exclude; }, "description" | "descriptionLocalizations">): MethodDecoratorEx; /** * Create a metadata instance for the class * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/discord) * * @category Decorator */ declare function Discord(): ClassDecoratorEx; /** * Define middleware for buttons, events, select menus, simple commands, slashes, etc. * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/guard) * * @category Decorator */ declare function Guard(...fns: GuardFunction[]): ClassMethodDecorator; /** * Use buttons, events, select menus, simple commands and slashes for a defined guild only * * @param guildId - Guild identifier * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/guild) * * @category Decorator */ declare function Guild(guildId: IGuild): ClassMethodDecorator; /** * Use buttons, events, select menus, simple commands and slashes for a defined guild only * * @param guildIds - Guild identifiers * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/guild) * * @category Decorator */ declare function Guild(...guildIds: IGuild[]): ClassMethodDecorator; /** * Create modal interaction handler * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/modal-component) * * @category Decorator */ declare function ModalComponent(): MethodDecoratorEx; /** * Create modal interaction handler * * @param options - Component options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/modal-component) * * @category Decorator */ declare function ModalComponent(options: ComponentOptions): MethodDecoratorEx; /** * Handle discord events with a defined handler * * @param options - Event options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/on) * * @category Decorator */ declare function On(options?: EventOptions): MethodDecoratorEx; declare namespace On { var rest: (options?: RestEventOptions) => MethodDecoratorEx; } /** * Handle discord events once only with a defined handler * * @param options - Event parameters * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/once) * * @category Decorator */ declare function Once(options?: EventOptions): MethodDecoratorEx; declare namespace Once { var rest: (options?: RestEventOptions) => MethodDecoratorEx; } /** * Handle a reaction with a specified emoji * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/reaction) * * @category Decorator */ declare function Reaction(): MethodDecoratorEx; /** * Handle a reaction with a specified emoji (a Unicode string, custom name, or Snowflake) * * @param options - reaction options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/general/reaction) * * @category Decorator */ declare function Reaction(options: ReactionOptions): MethodDecoratorEx; /** * Interact with select menu with a defined identifier * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/select-menu-component) * * @category Decorator */ declare function SelectMenuComponent(): MethodDecoratorEx; /** * Interact with select menu with a defined identifier * * @param options - Component options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/gui/select-menu-component) * * @category Decorator */ declare function SelectMenuComponent(options: ComponentOptions): MethodDecoratorEx; /** * Handle a simple command with a defined name * * Example ``!hello world`` * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/simple-command) * * @category Decorator */ declare function SimpleCommand(): MethodDecoratorEx; /** * Handle a simple command with a defined name * * Example ``!hello world`` * * @param options - Command options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/simple-command) * * @category Decorator */ declare function SimpleCommand(options: SimpleCommandOptions): MethodDecoratorEx; /** * Add a simple command option * * @param options - Command option options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/simple-command-option) * * @category Decorator */ declare function SimpleCommandOption(options: SimpleCommandOptionOptions): ParameterDecoratorEx; /** * Handle a slash command with a defined name * * @param options - Application command options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash) * * @category Decorator */ declare function Slash(options: SlashCommandBuilder): MethodDecoratorEx; /** * Handle a slash command with a defined name * * @param options - Application command options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash) * * @category Decorator */ declare function Slash(options: ApplicationCommandOptions, NotEmpty>): MethodDecoratorEx; /** * The slash command option can implement autocompletion for string and number types * * @param choices - choices * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-choice) * * @category Decorator */ declare function SlashChoice(...choices: NotEmpty[]): ParameterDecoratorEx; /** * The slash command option can implement autocompletion for string and number types * * @param choices - choices * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-choice) * * @category Decorator */ declare function SlashChoice(...choices: number[]): ParameterDecoratorEx; /** * The slash command option can implement autocompletion for string and number types * * @param choices - choices * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-choice) * * @category Decorator */ declare function SlashChoice(...choices: SlashChoiceType[]): ParameterDecoratorEx; /** * Assign a group to a method or class * * @param name - Name of group * ___ * * [View discordx documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-group) * * [View discord documentation](https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups) * * @category Decorator */ declare function SlashGroup(name: VerifyName): ClassMethodDecorator; /** * Assign a group to a method or class * * @param name - Name of group * @param root - Root name of group * ___ * * [View discordx documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-group) * * [View discord documentation](https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups) * * @category Decorator */ declare function SlashGroup(name: VerifyName, root: VerifyName): ClassMethodDecorator; /** * Create slash group * * @param options - Group options * ___ * * [View discordx documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-group) * * [View discord documentation](https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups) * * @category Decorator */ declare function SlashGroup(options: SlashGroupOptions, NotEmpty, VerifyName>): ClassDecoratorEx; /** * Add a slash command option * * @param options - Slash option options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-option) * * @category Decorator */ declare function SlashOption(options: SlashCommandAttachmentOption | SlashCommandBooleanOption | SlashCommandChannelOption | SlashCommandIntegerOption | SlashCommandMentionableOption | SlashCommandNumberOption | SlashCommandRoleOption | SlashCommandStringOption | SlashCommandUserOption, transformer?: TransformerFunction): ParameterDecoratorEx; /** * Add a slash command option * * @param options - Slash option options * ___ * * [View Documentation](https://discordx.js.org/docs/discordx/decorators/command/slash-option) * * @category Decorator */ declare function SlashOption(options: SlashOptionOptions, NotEmpty>, transformer?: TransformerFunction): ParameterDecoratorEx; declare class ApplicationCommandManager { private client; constructor(client: Client); initApplicationCommands(retainDeleted?: boolean): Promise; clearApplicationCommands(...guilds: Snowflake[]): Promise; private getCommandsByGuild; private initGuildApplicationCommands; private initGlobalApplicationCommands; private categorizeGuildCommands; private categorizeGlobalCommands; private logCommandChanges; private prepareBulkUpdate; } declare class DebugManager { private client; constructor(client: Client); printDebug(): void; private printEvents; private printComponents; private printComponentType; private printReactions; private printContextMenus; private printApplicationCommands; private printOptions; private printSimpleCommands; private printSimpleOptions; } interface EventConfig { eventName: string; isOnce: boolean; isRest: boolean; } interface EventGroup extends EventConfig { handlers: DOn[]; } declare class EventManager { private groups; private cleanupFunctions; add(event: DOn): void; /** * Execute handlers for a specific event group */ private executeHandlers; /** * Trigger an event manually (used for testing) */ trigger(client: Client, { eventName, isOnce, isRest }: EventConfig): (...params: any[]) => Promise; initEvents(client: Client): void; removeEvents(): void; clear(): void; } declare class InteractionHandler { private client; constructor(client: Client); executeInteraction(interaction: Interaction): Awaited; executeCommandInteraction(interaction: ChatInputCommandInteraction | AutocompleteInteraction): Promise; executeComponent(components: readonly DComponent[], interaction: ButtonInteraction | ModalSubmitInteraction | AnySelectMenuInteraction): Promise; executeContextMenu(interaction: ContextMenuCommandInteraction): Awaited; private getApplicationCommandGroupTree; private getApplicationCommandFromTree; } declare class ReactionManager { private client; constructor(client: Client); executeReaction(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser): Promise; parseReaction(message: MessageReaction | PartialMessageReaction): DReaction | undefined; } declare class SimpleCommandManager { private client; constructor(client: Client); executeCommand(message: Message, caseSensitive?: boolean): Promise; parseCommand(message: Message, caseSensitive?: boolean): Promise; private getMessagePrefix; } /** * @category Internal */ declare class MetadataStorage { private static _isBuilt; private static _instance; private _discords; private _guards; private _modifiers; private _events; private _eventManager; private _buttonComponents; private _modalComponents; private _selectMenuComponents; private _reactions; private _simpleCommandOptions; private _simpleCommands; private _simpleCommandsByName; private _simpleCommandMappedPrefix; private _applicationCommandMessages; private _applicationCommandSlashes; private _applicationCommandSlashesFlat; private _applicationCommandSlashOptions; private _applicationCommandUsers; private _applicationCommandSlashGroups; private _applicationCommandSlashSubGroups; static clear(): void; static get isBuilt(): boolean; static get instance(): MetadataStorage; static set instance(value: MetadataStorage); get applicationCommandSlashes(): readonly DApplicationCommand[]; get applicationCommandSlashesFlat(): readonly DApplicationCommand[]; get applicationCommandSlashOptions(): readonly DApplicationCommandOption[]; get applicationCommandSlashGroups(): readonly DApplicationCommandGroup[]; get applicationCommandSlashSubGroups(): readonly DApplicationCommandGroup[]; get applicationCommandUsers(): readonly DApplicationCommand[]; get applicationCommandMessages(): readonly DApplicationCommand[]; get applicationCommands(): readonly DApplicationCommand[]; get buttonComponents(): readonly DComponent[]; get discords(): readonly DDiscord[]; private get discordMembers(); get events(): readonly DOn[]; get eventManager(): EventManager; get isBuilt(): boolean; get modalComponents(): readonly DComponent[]; get reactions(): readonly DReaction[]; get selectMenuComponents(): readonly DComponent[]; get simpleCommandsByName(): readonly ISimpleCommandByName[]; get simpleCommandMappedPrefix(): readonly string[]; get simpleCommands(): readonly DSimpleCommand[]; /** * Get the list of used events without duplications */ get usedEvents(): readonly DOn[]; addApplicationCommandSlash(slash: DApplicationCommand): void; addApplicationCommandUser(slash: DApplicationCommand): void; addApplicationCommandMessage(slash: DApplicationCommand): void; addApplicationCommandSlashOption(option: DApplicationCommandOption): void; addApplicationCommandSlashGroups(group: DApplicationCommandGroup>): void; addApplicationCommandSlashSubGroups(subGroup: DApplicationCommandGroup>): void; addComponentButton(button: DComponent): void; addComponentModal(selectMenu: DComponent): void; addComponentSelectMenu(selectMenu: DComponent): void; addDiscord(discord: DDiscord): void; addGuard(guard: DGuard): void; addModifier(modifier: Modifier): void; addOn(on: DOn): void; addReaction(reaction: DReaction): void; addSimpleCommand(cmd: DSimpleCommand): void; addSimpleCommandOption(cmdOption: DSimpleCommandOption): void; build(): Promise; private buildSimpleCommands; private groupSlashes; } /** * Converts the provided arguments into a single flat array of strings. * Accepts multiple arguments, each of which can be a string or an array of strings. * If an argument is a string, it is wrapped in an array. If it is an array, it is flattened. * * @param {...(string | string[])[]} input - One or more strings or arrays of strings. * @returns {string[]} A flat array of strings. */ declare function toStringArray(...input: (string | string[])[]): string[]; /** * Recursively match field * * @param object * @param keys * @param onMatch */ declare function RecursivelyMatchField(object: Record, keys: string[], onMatch: (object: any, key: string) => void): void; /** * Check if ApplicationCommand and DApplicationCommand has same properties * * @param findCommand * @param DCommand * @param isGuild * @returns */ declare function isApplicationCommandEqual(findCommand: ApplicationCommand, DCommand: DApplicationCommand, isGuild?: true): boolean; /** * Resolve IGuilds * @param client * @param command * @param guilds * @returns */ declare const resolveIGuilds: (client: Client, command: DApplicationCommand | DComponent | DReaction | SimpleCommandMessage | undefined, guilds: IGuild[]) => Promise; /** * Slash name validator * @param name - name * @returns */ declare function SlashNameValidator(name: string): true; export { type ApplicationCommandDataEx, ApplicationCommandManager, ApplicationCommandMixin, type ApplicationCommandOptionChoiceDataEx, type ApplicationCommandOptions, type ArgSplitter, type ArgsOf, type Awaitable, Bot, ButtonComponent, Client, type ClientOptions, type ComponentOptions, ComponentType, ContextMenu, DApplicationCommand, DApplicationCommandGroup, DApplicationCommandOption, DApplicationCommandOptionChoice, DComponent, DDiscord, DGuard, DOn, DReaction, DSimpleCommand, DSimpleCommandOption, DebugManager, Discord, type EventConfig, type EventGroup, EventManager, type EventOptions, type ForbidCharacter, Guard, type GuardFunction, Guild, type IGuild, type ILogger, type IPrefix, type IPrefixResolver, type ISimpleCommandByName, InteractionHandler, MetadataStorage, ModalComponent, type Next, type NotEmpty, type NotEmptyCheck, On, Once, Reaction, ReactionManager, type ReactionOptions, RecursivelyMatchField, type RestArgsOf, type RestEventOptions, SelectMenuComponent, SimpleCommand, type SimpleCommandConfig, SimpleCommandManager, SimpleCommandMessage, SimpleCommandOption, type SimpleCommandOptionOptions, SimpleCommandOptionType, type SimpleCommandOptions, SimpleCommandParseType, type SimpleOptionType, Slash, type SlashAutoCompleteOption, SlashChoice, type SlashChoiceType, SlashGroup, type SlashGroupBase, type SlashGroupOptions, type SlashGroupRoot, type SlashGroupSubRoot, SlashNameValidator, SlashOption, type SlashOptionAutoCompleteOptions, type SlashOptionBaseOptions, type SlashOptionChannelOptions, type SlashOptionNumberOptions, type SlashOptionOptions, type SlashOptionResult, type SlashOptionStringOptions, type SpecialCharacters, SpecialCharactersList, type TransformerFunction, type TruncateTo32, type VName, type VerifyName, type WhitelistWords, isApplicationCommandEqual, resolveIGuilds, toStringArray };