seedcord 0.11.0 → 0.12.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ActionRowBuilder, ButtonBuilder, ChannelSelectMenuBuilder, ContainerBuilder, ContextMenuCommandBuilder, EmbedBuilder, FileBuilder, FileUploadBuilder, LabelBuilder, MediaGalleryBuilder, MentionableSelectMenuBuilder, ModalBuilder, RoleSelectMenuBuilder, SectionBuilder, SeparatorBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, TextInputBuilder, UserSelectMenuBuilder } from "discord.js";
1
+ import { ActionRowBuilder, ButtonBuilder, ChannelSelectMenuBuilder, CheckboxBuilder, CheckboxGroupBuilder, CheckboxGroupOptionBuilder, ContainerBuilder, ContextMenuCommandBuilder, EmbedBuilder, FileBuilder, FileUploadBuilder, LabelBuilder, MediaGalleryBuilder, MentionableSelectMenuBuilder, ModalBuilder, RadioGroupBuilder, RadioGroupOptionBuilder, RoleSelectMenuBuilder, SectionBuilder, SeparatorBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, TextInputBuilder, UserSelectMenuBuilder } from "discord.js";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/non-empty-tuple.d.ts
4
4
  /**
@@ -82,7 +82,7 @@ type Join<Items extends readonly JoinableItem[], Delimiter extends string> = Ite
82
82
  //#endregion
83
83
  //#region src/interfaces/Components.d.ts
84
84
  /**
85
- * Available Discord.js builder classes for use with BuilderComponent
85
+ * Available Discord.js builder classes for use with BuilderComponent for commands, embeds, modals, etc.
86
86
  *
87
87
  * @internal
88
88
  */
@@ -96,6 +96,11 @@ declare const BuilderTypes: {
96
96
  label: typeof LabelBuilder;
97
97
  text_input: typeof TextInputBuilder;
98
98
  file_upload: typeof FileUploadBuilder;
99
+ checkbox: typeof CheckboxBuilder;
100
+ checkbox_group: typeof CheckboxGroupBuilder;
101
+ checkbox_group_option: typeof CheckboxGroupOptionBuilder;
102
+ radio_group: typeof RadioGroupBuilder;
103
+ radio_group_option: typeof RadioGroupOptionBuilder;
99
104
  button: typeof ButtonBuilder;
100
105
  menu_string: typeof StringSelectMenuBuilder;
101
106
  menu_option_string: typeof StringSelectMenuOptionBuilder;
@@ -111,7 +116,7 @@ declare const BuilderTypes: {
111
116
  separator: typeof SeparatorBuilder;
112
117
  };
113
118
  /**
114
- * Available Discord.js action row classes for use with RowComponent
119
+ * Available Discord.js action row classes for use with RowComponent for Select Menus and Buttons
115
120
  *
116
121
  * @internal
117
122
  */
@@ -134,11 +139,11 @@ type InstantiatedBuilder<BuilderKey extends BuilderType> = InstanceType<(typeof
134
139
  /**
135
140
  * Available Discord.js action row types for use with RowComponent
136
141
  */
137
- type ActionRowComponentType = keyof typeof RowTypes;
142
+ type RowType = keyof typeof RowTypes;
138
143
  /**
139
144
  * @internal
140
145
  */
141
- type InstantiatedActionRow<RowKey extends ActionRowComponentType> = InstanceType<(typeof RowTypes)[RowKey]>;
146
+ type InstantiatedActionRow<RowKey extends RowType> = InstanceType<(typeof RowTypes)[RowKey]>;
142
147
  /**
143
148
  * Base class for Discord component wrappers
144
149
  *
@@ -159,7 +164,7 @@ declare abstract class BaseComponent<TComponent> {
159
164
  * Please do not use for further configuration, use `this.instance` for that.
160
165
  * @example new SomeComponent().component
161
166
  */
162
- abstract get component(): InstantiatedBuilder<BuilderType> | InstantiatedActionRow<ActionRowComponentType>;
167
+ abstract get component(): InstantiatedBuilder<BuilderType> | InstantiatedActionRow<RowType>;
163
168
  /**
164
169
  * Gets the component instance for configuration
165
170
  *
@@ -210,7 +215,7 @@ declare abstract class BuilderComponent<BuilderKey extends BuilderType> extends
210
215
  *
211
216
  * @typeParam RowKey - The Discord.js action row type being wrapped
212
217
  */
213
- declare abstract class RowComponent<RowKey extends ActionRowComponentType> extends BaseComponent<InstantiatedActionRow<RowKey>> {
218
+ declare abstract class RowComponent<RowKey extends RowType> extends BaseComponent<InstantiatedActionRow<RowKey>> {
214
219
  readonly type: RowKey;
215
220
  protected constructor(type: RowKey);
216
221
  get component(): InstantiatedActionRow<RowKey>;
@@ -240,5 +245,5 @@ declare abstract class CustomError extends Error {
240
245
  set emit(value: boolean);
241
246
  }
242
247
  //#endregion
243
- export { RowComponent as a, CustomError as i, BuilderComponent as n, NonEmptyTuple as o, BuilderType as r, ActionRowComponentType as t };
244
- //# sourceMappingURL=Components-D-AZ6ESx.d.mts.map
248
+ export { RowType as a, RowComponent as i, BuilderType as n, NonEmptyTuple as o, CustomError as r, BuilderComponent as t };
249
+ //# sourceMappingURL=Components-BS8zPPq7.d.mts.map
@@ -1,4 +1,4 @@
1
- import { ActionRowBuilder, ButtonBuilder, ChannelSelectMenuBuilder, ContainerBuilder, ContextMenuCommandBuilder, EmbedBuilder, FileBuilder, FileUploadBuilder, InteractionContextType, LabelBuilder, MediaGalleryBuilder, MentionableSelectMenuBuilder, ModalBuilder, RoleSelectMenuBuilder, SectionBuilder, SeparatorBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, TextInputBuilder, UserSelectMenuBuilder, resolveColor } from "discord.js";
1
+ import { ActionRowBuilder, ButtonBuilder, ChannelSelectMenuBuilder, CheckboxBuilder, CheckboxGroupBuilder, CheckboxGroupOptionBuilder, ContainerBuilder, ContextMenuCommandBuilder, EmbedBuilder, FileBuilder, FileUploadBuilder, InteractionContextType, LabelBuilder, MediaGalleryBuilder, MentionableSelectMenuBuilder, ModalBuilder, RadioGroupBuilder, RadioGroupOptionBuilder, RoleSelectMenuBuilder, SectionBuilder, SeparatorBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, TextInputBuilder, UserSelectMenuBuilder, resolveColor } from "discord.js";
2
2
 
3
3
  //#region src/miscellaneous/botColorHolder.ts
4
4
  const DEFAULT_COLOR = "Default";
@@ -15,7 +15,7 @@ function getBotColor() {
15
15
  //#endregion
16
16
  //#region src/interfaces/Components.ts
17
17
  /**
18
- * Available Discord.js builder classes for use with BuilderComponent
18
+ * Available Discord.js builder classes for use with BuilderComponent for commands, embeds, modals, etc.
19
19
  *
20
20
  * @internal
21
21
  */
@@ -29,6 +29,11 @@ const BuilderTypes = {
29
29
  label: LabelBuilder,
30
30
  text_input: TextInputBuilder,
31
31
  file_upload: FileUploadBuilder,
32
+ checkbox: CheckboxBuilder,
33
+ checkbox_group: CheckboxGroupBuilder,
34
+ checkbox_group_option: CheckboxGroupOptionBuilder,
35
+ radio_group: RadioGroupBuilder,
36
+ radio_group_option: RadioGroupOptionBuilder,
32
37
  button: ButtonBuilder,
33
38
  menu_string: StringSelectMenuBuilder,
34
39
  menu_option_string: StringSelectMenuOptionBuilder,
@@ -44,7 +49,7 @@ const BuilderTypes = {
44
49
  separator: SeparatorBuilder
45
50
  };
46
51
  /**
47
- * Available Discord.js action row classes for use with RowComponent
52
+ * Available Discord.js action row classes for use with RowComponent for Select Menus and Buttons
48
53
  *
49
54
  * @internal
50
55
  */
@@ -214,4 +219,4 @@ var DatabaseError = class extends CustomError {
214
219
 
215
220
  //#endregion
216
221
  export { setBotColor as a, RowComponent as i, BuilderComponent as n, CustomError as r, DatabaseError as t };
217
- //# sourceMappingURL=Database-CqvL4DO2.mjs.map
222
+ //# sourceMappingURL=Database-D-mgXwZ_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Database-D-mgXwZ_.mjs","names":[],"sources":["../src/miscellaneous/botColorHolder.ts","../src/interfaces/Components.ts","../src/bot/defaults/errors/Database.ts"],"sourcesContent":["import type { ColorResolvable } from 'discord.js';\n\n// 'Default' is Discord.js's own sentinel for \"no explicit color\".\nconst DEFAULT_COLOR: ColorResolvable = 'Default';\n\nlet current: ColorResolvable = DEFAULT_COLOR;\n\n/** @internal */\nexport function setBotColor(color: ColorResolvable | undefined): void {\n current = color ?? DEFAULT_COLOR;\n}\n\n/** @internal */\nexport function getBotColor(): ColorResolvable {\n return current;\n}\n","import {\n ActionRowBuilder,\n ButtonBuilder,\n ChannelSelectMenuBuilder,\n CheckboxBuilder,\n CheckboxGroupBuilder,\n CheckboxGroupOptionBuilder,\n ContainerBuilder,\n ContextMenuCommandBuilder,\n EmbedBuilder,\n FileBuilder,\n FileUploadBuilder,\n InteractionContextType,\n LabelBuilder,\n MediaGalleryBuilder,\n MentionableSelectMenuBuilder,\n ModalBuilder,\n RadioGroupBuilder,\n RadioGroupOptionBuilder,\n RoleSelectMenuBuilder,\n SectionBuilder,\n SeparatorBuilder,\n SlashCommandBuilder,\n SlashCommandSubcommandBuilder,\n SlashCommandSubcommandGroupBuilder,\n StringSelectMenuBuilder,\n StringSelectMenuOptionBuilder,\n TextDisplayBuilder,\n TextInputBuilder,\n UserSelectMenuBuilder,\n resolveColor\n} from 'discord.js';\n\nimport { getBotColor } from '@miscellaneous/botColorHolder';\n\nimport type { Join, NonEmptyTuple } from 'type-fest';\n\n/**\n * Available Discord.js builder classes for use with BuilderComponent for commands, embeds, modals, etc.\n *\n * @internal\n */\nexport const BuilderTypes = {\n // Command Components\n command: SlashCommandBuilder,\n context_menu: ContextMenuCommandBuilder,\n subcommand: SlashCommandSubcommandBuilder,\n group: SlashCommandSubcommandGroupBuilder,\n\n // Embed Components\n embed: EmbedBuilder,\n\n // Modal Components\n modal: ModalBuilder,\n label: LabelBuilder,\n text_input: TextInputBuilder,\n file_upload: FileUploadBuilder,\n checkbox: CheckboxBuilder,\n checkbox_group: CheckboxGroupBuilder,\n checkbox_group_option: CheckboxGroupOptionBuilder,\n radio_group: RadioGroupBuilder,\n radio_group_option: RadioGroupOptionBuilder,\n\n // Action Row Components\n button: ButtonBuilder,\n menu_string: StringSelectMenuBuilder,\n menu_option_string: StringSelectMenuOptionBuilder,\n menu_user: UserSelectMenuBuilder,\n menu_channel: ChannelSelectMenuBuilder,\n menu_mentionable: MentionableSelectMenuBuilder,\n menu_role: RoleSelectMenuBuilder,\n\n // ComponentsV2\n container: ContainerBuilder,\n text_display: TextDisplayBuilder,\n file: FileBuilder,\n media: MediaGalleryBuilder,\n section: SectionBuilder,\n separator: SeparatorBuilder\n};\n\n/**\n * Available Discord.js action row classes for use with RowComponent for Select Menus and Buttons\n *\n * @internal\n */\nexport const RowTypes: {\n button: typeof ActionRowBuilder<ButtonBuilder>;\n menu_string: typeof ActionRowBuilder<StringSelectMenuBuilder>;\n menu_user: typeof ActionRowBuilder<UserSelectMenuBuilder>;\n menu_channel: typeof ActionRowBuilder<ChannelSelectMenuBuilder>;\n menu_mentionable: typeof ActionRowBuilder<MentionableSelectMenuBuilder>;\n menu_role: typeof ActionRowBuilder<RoleSelectMenuBuilder>;\n} = {\n button: ActionRowBuilder<ButtonBuilder>,\n menu_string: ActionRowBuilder<StringSelectMenuBuilder>,\n menu_user: ActionRowBuilder<UserSelectMenuBuilder>,\n menu_channel: ActionRowBuilder<ChannelSelectMenuBuilder>,\n menu_mentionable: ActionRowBuilder<MentionableSelectMenuBuilder>,\n menu_role: ActionRowBuilder<RoleSelectMenuBuilder>\n};\n\n/**\n * Available Discord.js builder types for use with BuilderComponent\n */\nexport type BuilderType = keyof typeof BuilderTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedBuilder<BuilderKey extends BuilderType> = InstanceType<(typeof BuilderTypes)[BuilderKey]>;\n\n/**\n * Available Discord.js action row types for use with RowComponent\n */\nexport type RowType = keyof typeof RowTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedActionRow<RowKey extends RowType> = InstanceType<(typeof RowTypes)[RowKey]>;\n\n/**\n * Base class for Discord component wrappers\n *\n * Provides common functionality for building Discord components with proper typing.\n *\n * @typeParam TComponent - The Discord.js component type being wrapped\n *\n * @internal\n */\nexport abstract class BaseComponent<TComponent> {\n private readonly _component: TComponent;\n\n protected constructor(ComponentClass: new () => TComponent) {\n this._component = new ComponentClass();\n }\n\n /**\n * Gets the built component (should be considered read-only)\n *\n * Returns the finalized component ready for use in Discord messages.\n *\n * Please do not use for further configuration, use `this.instance` for that.\n * @example new SomeComponent().component\n */\n public abstract get component(): InstantiatedBuilder<BuilderType> | InstantiatedActionRow<RowType>;\n\n /**\n * Gets the component instance for configuration\n *\n * Use this to access Discord.js builder methods like setTitle(), setDescription(), etc.\n *\n * Use this in your component classes to configure the builder\n * @example this.instance.setTitle('My Modal')\n */\n protected get instance(): TComponent {\n return this._component;\n }\n\n /**\n * Builds a customId string for interactive components with no arguments\n *\n * @param prefix - The route prefix that handlers will match against\n * @returns The prefix as the customId\n */\n public buildCustomId<Prefix extends string>(prefix: Prefix): Prefix;\n /**\n * Builds a customId string for interactive components\n *\n * Creates customIds in the format `prefix:arg1-arg2-arg3` for buttons, modals, etc.\n * Arguments are joined with hyphens and separated from prefix with a colon.\n *\n * @param prefix - The route prefix that handlers will match against\n * @param args - Additional arguments to encode in the customId\n * @returns Formatted customId string\n */\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string>>(\n prefix: Prefix,\n ...args: Args\n ): `${Prefix}:${Join<Args, '-'>}`;\n\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string> | []>(\n prefix: Prefix,\n ...args: Args\n ): Prefix | `${Prefix}:${string}` {\n return args.length === 0 ? prefix : `${prefix}:${args.join('-')}`;\n }\n}\n\n/**\n * Base class for Discord.js builder components\n *\n * Wraps Discord.js builders (SlashCommandBuilder, EmbedBuilder, etc.) with\n * Seedcord-specific defaults and helper methods.\n *\n * @typeParam BuilderKey - The type of Discord.js builder being wrapped\n */\nexport abstract class BuilderComponent<BuilderKey extends BuilderType> extends BaseComponent<\n InstantiatedBuilder<BuilderKey>\n> {\n private colorApplied = false;\n\n protected constructor(public readonly type: BuilderKey) {\n const ComponentClass = BuilderTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedBuilder<BuilderKey>);\n\n if (this.instance instanceof SlashCommandBuilder || this.instance instanceof ContextMenuCommandBuilder) {\n this.instance.setContexts(InteractionContextType.Guild);\n }\n }\n\n get component(): InstantiatedBuilder<BuilderKey> {\n this.applyBotColor();\n return this.instance;\n }\n\n // Resolving in the constructor would capture the default for a component built before setBotColor()\n // ran. The unset check keeps a color the subclass set for itself.\n private applyBotColor(): void {\n if (this.colorApplied) return;\n this.colorApplied = true;\n\n const color = getBotColor();\n if (this.instance instanceof EmbedBuilder) {\n if (this.instance.data.color === undefined) this.instance.setColor(color);\n } else if (this.instance instanceof ContainerBuilder) {\n const accent = this.instance.data.accent_color;\n if (accent === null || accent === undefined) {\n this.instance.setAccentColor(color === 'Default' ? undefined : resolveColor(color));\n }\n }\n }\n}\n\n/**\n * Base class for Discord action row components\n *\n * Wraps Discord.js action row builder with Seedcord-specific defaults and helper methods.\n *\n * @typeParam RowKey - The Discord.js action row type being wrapped\n */\nexport abstract class RowComponent<RowKey extends RowType> extends BaseComponent<InstantiatedActionRow<RowKey>> {\n protected constructor(public readonly type: RowKey) {\n const ComponentClass = RowTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedActionRow<RowKey>);\n }\n\n get component(): InstantiatedActionRow<RowKey> {\n return this.instance;\n }\n}\n\n/**\n * Pre-configured error embed with default styling\n *\n * This is bundled in {@link CustomError}s as the response.\n *\n * @internal\n */\nexport class BaseErrorEmbed extends BuilderComponent<'embed'> {\n /**\n * Creates a new error embed with default configuration.\n */\n public constructor() {\n super('embed');\n this.instance.setTitle('Cannot Proceed');\n }\n}\n\n/**\n * Base class for custom error types with Discord embed responses\n *\n * Errors extending CustomError should be used with the `Catchable` decorators to implement a control flow. These errors will be caught and handled by the framework to show the user the configured response.\n */\nexport abstract class CustomError extends Error {\n private _emit = false;\n public readonly response = new BaseErrorEmbed().component;\n\n protected constructor(public override message: string) {\n super(message);\n\n Error.captureStackTrace(this, this.constructor);\n }\n\n /**\n * Whether this error should be emitted to logs\n *\n * Controls logging behavior. Errors with emit=true will always be logged,\n * while emit=false errors may be suppressed in production.\n *\n * @returns True if the error should be logged\n */\n public get emit(): boolean {\n return this._emit;\n }\n\n /**\n * Sets whether this error should be emitted to logs\n */\n public set emit(value: boolean) {\n this._emit = value;\n }\n}\n","import { CustomError } from '@interfaces/Components';\n\nimport type { UUID } from 'crypto';\n\n/**\n * Generic database operation error with UUID tracking.\n *\n * Thrown for various database operation failures and includes\n * a UUID for error tracking and debugging purposes.\n *\n * @internal\n */\nexport class DatabaseError extends CustomError {\n /**\n * Creates a new DatabaseError.\n *\n * @param message - The error message describing what went wrong\n * @param uuid - A unique identifier for this specific error instance\n */\n constructor(\n message: string,\n public uuid: UUID\n ) {\n super(message);\n this.emit = true; // Emit in logs regardless of environment\n this.name = 'DatabaseError';\n\n this.response\n .setTitle('Database Error')\n .setDescription(`An error occurred while interacting with the database.\\n### UUID: \\`${this.uuid}\\``);\n }\n}\n"],"mappings":";;;AAGA,MAAM,gBAAiC;AAEvC,IAAI,UAA2B;;AAG/B,SAAgB,YAAY,OAA0C;CAClE,UAAU,SAAS;AACvB;;AAGA,SAAgB,cAA+B;CAC3C,OAAO;AACX;;;;;;;;;AC2BA,MAAa,eAAe;CAExB,SAAS;CACT,cAAc;CACd,YAAY;CACZ,OAAO;CAGP,OAAO;CAGP,OAAO;CACP,OAAO;CACP,YAAY;CACZ,aAAa;CACb,UAAU;CACV,gBAAgB;CAChB,uBAAuB;CACvB,aAAa;CACb,oBAAoB;CAGpB,QAAQ;CACR,aAAa;CACb,oBAAoB;CACpB,WAAW;CACX,cAAc;CACd,kBAAkB;CAClB,WAAW;CAGX,WAAW;CACX,cAAc;CACd,MAAM;CACN,OAAO;CACP,SAAS;CACT,WAAW;AACf;;;;;;AAOA,MAAa,WAOT;CACA,QAAQ;CACR,aAAa;CACb,WAAW;CACX,cAAc;CACd,kBAAkB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iBAA0B;;;;CAI1D,AAAO,cAAc;EACjB,MAAM,OAAO;EACb,KAAK,SAAS,SAAS,gBAAgB;CAC3C;AACJ;;;;;;AAOA,IAAsB,cAAtB,cAA0C,MAAM;CAIN;CAHtC,AAAQ,QAAQ;CAChB,AAAgB,WAAW,IAAI,eAAe,EAAE;CAEhD,AAAU,YAAY,AAAgB,SAAiB;EACnD,MAAM,OAAO;EADqB;EAGlC,MAAM,kBAAkB,MAAM,KAAK,WAAW;CAClD;;;;;;;;;CAUA,IAAW,OAAgB;EACvB,OAAO,KAAK;CAChB;;;;CAKA,IAAW,KAAK,OAAgB;EAC5B,KAAK,QAAQ;CACjB;AACJ;;;;;;;;;;;;ACnSA,IAAa,gBAAb,cAAmC,YAAY;CAShC;;;;;;;CAFX,YACI,SACA,AAAO,MACT;EACE,MAAM,OAAO;EAFN;EAGP,KAAK,OAAO;EACZ,KAAK,OAAO;EAEZ,KAAK,SACA,SAAS,gBAAgB,EACzB,eAAe,uEAAuE,KAAK,KAAK,GAAG;CAC5G;AACJ"}
@@ -15,7 +15,7 @@ function getBotColor() {
15
15
  //#endregion
16
16
  //#region src/interfaces/Components.ts
17
17
  /**
18
- * Available Discord.js builder classes for use with BuilderComponent
18
+ * Available Discord.js builder classes for use with BuilderComponent for commands, embeds, modals, etc.
19
19
  *
20
20
  * @internal
21
21
  */
@@ -29,6 +29,11 @@ const BuilderTypes = {
29
29
  label: discord_js.LabelBuilder,
30
30
  text_input: discord_js.TextInputBuilder,
31
31
  file_upload: discord_js.FileUploadBuilder,
32
+ checkbox: discord_js.CheckboxBuilder,
33
+ checkbox_group: discord_js.CheckboxGroupBuilder,
34
+ checkbox_group_option: discord_js.CheckboxGroupOptionBuilder,
35
+ radio_group: discord_js.RadioGroupBuilder,
36
+ radio_group_option: discord_js.RadioGroupOptionBuilder,
32
37
  button: discord_js.ButtonBuilder,
33
38
  menu_string: discord_js.StringSelectMenuBuilder,
34
39
  menu_option_string: discord_js.StringSelectMenuOptionBuilder,
@@ -44,7 +49,7 @@ const BuilderTypes = {
44
49
  separator: discord_js.SeparatorBuilder
45
50
  };
46
51
  /**
47
- * Available Discord.js action row classes for use with RowComponent
52
+ * Available Discord.js action row classes for use with RowComponent for Select Menus and Buttons
48
53
  *
49
54
  * @internal
50
55
  */
@@ -243,4 +248,4 @@ Object.defineProperty(exports, 'setBotColor', {
243
248
  return setBotColor;
244
249
  }
245
250
  });
246
- //# sourceMappingURL=Database-Xu_qxdiF.cjs.map
251
+ //# sourceMappingURL=Database-Dx7bRFrY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Database-Dx7bRFrY.cjs","names":["SlashCommandBuilder","ContextMenuCommandBuilder","SlashCommandSubcommandBuilder","SlashCommandSubcommandGroupBuilder","EmbedBuilder","ModalBuilder","LabelBuilder","TextInputBuilder","FileUploadBuilder","CheckboxBuilder","CheckboxGroupBuilder","CheckboxGroupOptionBuilder","RadioGroupBuilder","RadioGroupOptionBuilder","ButtonBuilder","StringSelectMenuBuilder","StringSelectMenuOptionBuilder","UserSelectMenuBuilder","ChannelSelectMenuBuilder","MentionableSelectMenuBuilder","RoleSelectMenuBuilder","ContainerBuilder","TextDisplayBuilder","FileBuilder","MediaGalleryBuilder","SectionBuilder","SeparatorBuilder","ActionRowBuilder","InteractionContextType"],"sources":["../src/miscellaneous/botColorHolder.ts","../src/interfaces/Components.ts","../src/bot/defaults/errors/Database.ts"],"sourcesContent":["import type { ColorResolvable } from 'discord.js';\n\n// 'Default' is Discord.js's own sentinel for \"no explicit color\".\nconst DEFAULT_COLOR: ColorResolvable = 'Default';\n\nlet current: ColorResolvable = DEFAULT_COLOR;\n\n/** @internal */\nexport function setBotColor(color: ColorResolvable | undefined): void {\n current = color ?? DEFAULT_COLOR;\n}\n\n/** @internal */\nexport function getBotColor(): ColorResolvable {\n return current;\n}\n","import {\n ActionRowBuilder,\n ButtonBuilder,\n ChannelSelectMenuBuilder,\n CheckboxBuilder,\n CheckboxGroupBuilder,\n CheckboxGroupOptionBuilder,\n ContainerBuilder,\n ContextMenuCommandBuilder,\n EmbedBuilder,\n FileBuilder,\n FileUploadBuilder,\n InteractionContextType,\n LabelBuilder,\n MediaGalleryBuilder,\n MentionableSelectMenuBuilder,\n ModalBuilder,\n RadioGroupBuilder,\n RadioGroupOptionBuilder,\n RoleSelectMenuBuilder,\n SectionBuilder,\n SeparatorBuilder,\n SlashCommandBuilder,\n SlashCommandSubcommandBuilder,\n SlashCommandSubcommandGroupBuilder,\n StringSelectMenuBuilder,\n StringSelectMenuOptionBuilder,\n TextDisplayBuilder,\n TextInputBuilder,\n UserSelectMenuBuilder,\n resolveColor\n} from 'discord.js';\n\nimport { getBotColor } from '@miscellaneous/botColorHolder';\n\nimport type { Join, NonEmptyTuple } from 'type-fest';\n\n/**\n * Available Discord.js builder classes for use with BuilderComponent for commands, embeds, modals, etc.\n *\n * @internal\n */\nexport const BuilderTypes = {\n // Command Components\n command: SlashCommandBuilder,\n context_menu: ContextMenuCommandBuilder,\n subcommand: SlashCommandSubcommandBuilder,\n group: SlashCommandSubcommandGroupBuilder,\n\n // Embed Components\n embed: EmbedBuilder,\n\n // Modal Components\n modal: ModalBuilder,\n label: LabelBuilder,\n text_input: TextInputBuilder,\n file_upload: FileUploadBuilder,\n checkbox: CheckboxBuilder,\n checkbox_group: CheckboxGroupBuilder,\n checkbox_group_option: CheckboxGroupOptionBuilder,\n radio_group: RadioGroupBuilder,\n radio_group_option: RadioGroupOptionBuilder,\n\n // Action Row Components\n button: ButtonBuilder,\n menu_string: StringSelectMenuBuilder,\n menu_option_string: StringSelectMenuOptionBuilder,\n menu_user: UserSelectMenuBuilder,\n menu_channel: ChannelSelectMenuBuilder,\n menu_mentionable: MentionableSelectMenuBuilder,\n menu_role: RoleSelectMenuBuilder,\n\n // ComponentsV2\n container: ContainerBuilder,\n text_display: TextDisplayBuilder,\n file: FileBuilder,\n media: MediaGalleryBuilder,\n section: SectionBuilder,\n separator: SeparatorBuilder\n};\n\n/**\n * Available Discord.js action row classes for use with RowComponent for Select Menus and Buttons\n *\n * @internal\n */\nexport const RowTypes: {\n button: typeof ActionRowBuilder<ButtonBuilder>;\n menu_string: typeof ActionRowBuilder<StringSelectMenuBuilder>;\n menu_user: typeof ActionRowBuilder<UserSelectMenuBuilder>;\n menu_channel: typeof ActionRowBuilder<ChannelSelectMenuBuilder>;\n menu_mentionable: typeof ActionRowBuilder<MentionableSelectMenuBuilder>;\n menu_role: typeof ActionRowBuilder<RoleSelectMenuBuilder>;\n} = {\n button: ActionRowBuilder<ButtonBuilder>,\n menu_string: ActionRowBuilder<StringSelectMenuBuilder>,\n menu_user: ActionRowBuilder<UserSelectMenuBuilder>,\n menu_channel: ActionRowBuilder<ChannelSelectMenuBuilder>,\n menu_mentionable: ActionRowBuilder<MentionableSelectMenuBuilder>,\n menu_role: ActionRowBuilder<RoleSelectMenuBuilder>\n};\n\n/**\n * Available Discord.js builder types for use with BuilderComponent\n */\nexport type BuilderType = keyof typeof BuilderTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedBuilder<BuilderKey extends BuilderType> = InstanceType<(typeof BuilderTypes)[BuilderKey]>;\n\n/**\n * Available Discord.js action row types for use with RowComponent\n */\nexport type RowType = keyof typeof RowTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedActionRow<RowKey extends RowType> = InstanceType<(typeof RowTypes)[RowKey]>;\n\n/**\n * Base class for Discord component wrappers\n *\n * Provides common functionality for building Discord components with proper typing.\n *\n * @typeParam TComponent - The Discord.js component type being wrapped\n *\n * @internal\n */\nexport abstract class BaseComponent<TComponent> {\n private readonly _component: TComponent;\n\n protected constructor(ComponentClass: new () => TComponent) {\n this._component = new ComponentClass();\n }\n\n /**\n * Gets the built component (should be considered read-only)\n *\n * Returns the finalized component ready for use in Discord messages.\n *\n * Please do not use for further configuration, use `this.instance` for that.\n * @example new SomeComponent().component\n */\n public abstract get component(): InstantiatedBuilder<BuilderType> | InstantiatedActionRow<RowType>;\n\n /**\n * Gets the component instance for configuration\n *\n * Use this to access Discord.js builder methods like setTitle(), setDescription(), etc.\n *\n * Use this in your component classes to configure the builder\n * @example this.instance.setTitle('My Modal')\n */\n protected get instance(): TComponent {\n return this._component;\n }\n\n /**\n * Builds a customId string for interactive components with no arguments\n *\n * @param prefix - The route prefix that handlers will match against\n * @returns The prefix as the customId\n */\n public buildCustomId<Prefix extends string>(prefix: Prefix): Prefix;\n /**\n * Builds a customId string for interactive components\n *\n * Creates customIds in the format `prefix:arg1-arg2-arg3` for buttons, modals, etc.\n * Arguments are joined with hyphens and separated from prefix with a colon.\n *\n * @param prefix - The route prefix that handlers will match against\n * @param args - Additional arguments to encode in the customId\n * @returns Formatted customId string\n */\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string>>(\n prefix: Prefix,\n ...args: Args\n ): `${Prefix}:${Join<Args, '-'>}`;\n\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string> | []>(\n prefix: Prefix,\n ...args: Args\n ): Prefix | `${Prefix}:${string}` {\n return args.length === 0 ? prefix : `${prefix}:${args.join('-')}`;\n }\n}\n\n/**\n * Base class for Discord.js builder components\n *\n * Wraps Discord.js builders (SlashCommandBuilder, EmbedBuilder, etc.) with\n * Seedcord-specific defaults and helper methods.\n *\n * @typeParam BuilderKey - The type of Discord.js builder being wrapped\n */\nexport abstract class BuilderComponent<BuilderKey extends BuilderType> extends BaseComponent<\n InstantiatedBuilder<BuilderKey>\n> {\n private colorApplied = false;\n\n protected constructor(public readonly type: BuilderKey) {\n const ComponentClass = BuilderTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedBuilder<BuilderKey>);\n\n if (this.instance instanceof SlashCommandBuilder || this.instance instanceof ContextMenuCommandBuilder) {\n this.instance.setContexts(InteractionContextType.Guild);\n }\n }\n\n get component(): InstantiatedBuilder<BuilderKey> {\n this.applyBotColor();\n return this.instance;\n }\n\n // Resolving in the constructor would capture the default for a component built before setBotColor()\n // ran. The unset check keeps a color the subclass set for itself.\n private applyBotColor(): void {\n if (this.colorApplied) return;\n this.colorApplied = true;\n\n const color = getBotColor();\n if (this.instance instanceof EmbedBuilder) {\n if (this.instance.data.color === undefined) this.instance.setColor(color);\n } else if (this.instance instanceof ContainerBuilder) {\n const accent = this.instance.data.accent_color;\n if (accent === null || accent === undefined) {\n this.instance.setAccentColor(color === 'Default' ? undefined : resolveColor(color));\n }\n }\n }\n}\n\n/**\n * Base class for Discord action row components\n *\n * Wraps Discord.js action row builder with Seedcord-specific defaults and helper methods.\n *\n * @typeParam RowKey - The Discord.js action row type being wrapped\n */\nexport abstract class RowComponent<RowKey extends RowType> extends BaseComponent<InstantiatedActionRow<RowKey>> {\n protected constructor(public readonly type: RowKey) {\n const ComponentClass = RowTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedActionRow<RowKey>);\n }\n\n get component(): InstantiatedActionRow<RowKey> {\n return this.instance;\n }\n}\n\n/**\n * Pre-configured error embed with default styling\n *\n * This is bundled in {@link CustomError}s as the response.\n *\n * @internal\n */\nexport class BaseErrorEmbed extends BuilderComponent<'embed'> {\n /**\n * Creates a new error embed with default configuration.\n */\n public constructor() {\n super('embed');\n this.instance.setTitle('Cannot Proceed');\n }\n}\n\n/**\n * Base class for custom error types with Discord embed responses\n *\n * Errors extending CustomError should be used with the `Catchable` decorators to implement a control flow. These errors will be caught and handled by the framework to show the user the configured response.\n */\nexport abstract class CustomError extends Error {\n private _emit = false;\n public readonly response = new BaseErrorEmbed().component;\n\n protected constructor(public override message: string) {\n super(message);\n\n Error.captureStackTrace(this, this.constructor);\n }\n\n /**\n * Whether this error should be emitted to logs\n *\n * Controls logging behavior. Errors with emit=true will always be logged,\n * while emit=false errors may be suppressed in production.\n *\n * @returns True if the error should be logged\n */\n public get emit(): boolean {\n return this._emit;\n }\n\n /**\n * Sets whether this error should be emitted to logs\n */\n public set emit(value: boolean) {\n this._emit = value;\n }\n}\n","import { CustomError } from '@interfaces/Components';\n\nimport type { UUID } from 'crypto';\n\n/**\n * Generic database operation error with UUID tracking.\n *\n * Thrown for various database operation failures and includes\n * a UUID for error tracking and debugging purposes.\n *\n * @internal\n */\nexport class DatabaseError extends CustomError {\n /**\n * Creates a new DatabaseError.\n *\n * @param message - The error message describing what went wrong\n * @param uuid - A unique identifier for this specific error instance\n */\n constructor(\n message: string,\n public uuid: UUID\n ) {\n super(message);\n this.emit = true; // Emit in logs regardless of environment\n this.name = 'DatabaseError';\n\n this.response\n .setTitle('Database Error')\n .setDescription(`An error occurred while interacting with the database.\\n### UUID: \\`${this.uuid}\\``);\n }\n}\n"],"mappings":";;;AAGA,MAAM,gBAAiC;AAEvC,IAAI,UAA2B;;AAG/B,SAAgB,YAAY,OAA0C;CAClE,UAAU,SAAS;AACvB;;AAGA,SAAgB,cAA+B;CAC3C,OAAO;AACX;;;;;;;;;AC2BA,MAAa,eAAe;CAExB,SAASA;CACT,cAAcC;CACd,YAAYC;CACZ,OAAOC;CAGP,OAAOC;CAGP,OAAOC;CACP,OAAOC;CACP,YAAYC;CACZ,aAAaC;CACb,UAAUC;CACV,gBAAgBC;CAChB,uBAAuBC;CACvB,aAAaC;CACb,oBAAoBC;CAGpB,QAAQC;CACR,aAAaC;CACb,oBAAoBC;CACpB,WAAWC;CACX,cAAcC;CACd,kBAAkBC;CAClB,WAAWC;CAGX,WAAWC;CACX,cAAcC;CACd,MAAMC;CACN,OAAOC;CACP,SAASC;CACT,WAAWC;AACf;;;;;;AAOA,MAAa,WAOT;CACA,QAAQC;CACR,aAAaA;CACb,WAAWA;CACX,cAAcA;CACd,kBAAkBA;CAClB,WAAWA;AACf;;;;;;;;;;AA+BA,IAAsB,gBAAtB,MAAgD;CAC5C,AAAiB;CAEjB,AAAU,YAAY,gBAAsC;EACxD,KAAK,aAAa,IAAI,eAAe;CACzC;;;;;;;;;CAoBA,IAAc,WAAuB;EACjC,OAAO,KAAK;CAChB;CAwBA,AAAO,cACH,QACA,GAAG,MAC2B;EAC9B,OAAO,KAAK,WAAW,IAAI,SAAS,GAAG,OAAO,GAAG,KAAK,K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M,KAAK,WAAW;CAClD;;;;;;;;;CAUA,IAAW,OAAgB;EACvB,OAAO,KAAK;CAChB;;;;CAKA,IAAW,KAAK,OAAgB;EAC5B,KAAK,QAAQ;CACjB;AACJ;;;;;;;;;;;;ACnSA,IAAa,gBAAb,cAAmC,YAAY;CAShC;;;;;;;CAFX,YACI,SACA,AAAO,MACT;EACE,MAAM,OAAO;EAFN;EAGP,KAAK,OAAO;EACZ,KAAK,OAAO;EAEZ,KAAK,SACA,SAAS,gBAAgB,EACzB,eAAe,uEAAuE,KAAK,KAAK,GAAG;CAC5G;AACJ"}
package/dist/index.cjs CHANGED
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  }) : target, mod));
27
27
 
28
28
  //#endregion
29
- const require_Database = require('./Database-Xu_qxdiF.cjs');
29
+ const require_Database = require('./Database-Dx7bRFrY.cjs');
30
30
  require("reflect-metadata");
31
31
  let _seedcord_services = require("@seedcord/services");
32
32
  let _seedcord_services_internal = require("@seedcord/services/internal");
@@ -2990,7 +2990,7 @@ var Seedcord = class Seedcord extends Pluggable {
2990
2990
  //#endregion
2991
2991
  //#region src/index.ts
2992
2992
  /** Package version */
2993
- const version = "0.11.0";
2993
+ const version = "0.12.0-next.0";
2994
2994
 
2995
2995
  //#endregion
2996
2996
  exports.AutocompleteHandler = AutocompleteHandler;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as RowComponent, i as CustomError, n as BuilderComponent, o as NonEmptyTuple, r as BuilderType, t as ActionRowComponentType } from "./Components-D-AZ6ESx.mjs";
1
+ import { a as RowType, i as RowComponent, n as BuilderType, o as NonEmptyTuple, r as CustomError, t as BuilderComponent } from "./Components-BS8zPPq7.mjs";
2
2
  import { CoordinatedShutdown, CoordinatedStartup, Logger, SEEventMapLike, SENoEvents, StartupPhase, StrictEventEmitter } from "@seedcord/services";
3
3
  import { ActionRowBuilder, AnySelectMenuInteraction, ApplicationEmoji, AutocompleteFocusedOption, AutocompleteInteraction, ButtonInteraction, ChannelSelectMenuInteraction, ChatInputCommandInteraction, Client, ClientEvents, Collection, ComponentType, ContextMenuCommandBuilder, ContextMenuCommandInteraction, EmbedBuilder, Events, Guild, GuildEmoji, GuildMember, Interaction, MentionableSelectMenuInteraction, Message, MessageActionRowComponentBuilder, MessageComponentInteraction, MessageComponentType, ModalSubmitInteraction, Role, RoleSelectMenuInteraction, SlashCommandBuilder, Snowflake, StringSelectMenuInteraction, TextChannel, TextChannelResolvable, User, UserSelectMenuInteraction, WebhookClient } from "discord.js";
4
4
  import { SeedcordBrand } from "@seedcord/types/internal";
@@ -3771,5 +3771,5 @@ declare class Seedcord extends Pluggable implements Core {
3771
3771
  /** Package version */
3772
3772
  declare const version: string;
3773
3773
  //#endregion
3774
- export { type ActionRowComponentType, type AllSubscriptions, AssignRoleErrorCtors, AutocompleteHandler, AutocompleteRoute, type BotEvents, type BotPermissionScope, BuilderComponent, type BuilderType, ButtonRoute, Catchable, type CatchableOptions, type CheckPermissionOptions, Checkable, CommandRouteString, Confirmable, type ConfirmableClassicOptions, type ConfirmableComponentsV2Options, type ConfirmableContext, type ConfirmableDecision, type ConfirmableDecisionByCustomIds, type ConfirmableDecisionByResolver, type ConfirmableFactory, type ConfirmableOptions, type ConfirmableOutcomeUiClassic, type ConfirmableOutcomeUiV2, type ConfirmableQuestionInput, type ConfirmableResolution, type ConfirmableSharedOptions, ContextMenuRoute, type Core, CustomError, Emojis, EventCatchable, type EventCatchableOptions, EventHandler, EventMiddleware, type EventSpec, HasPermsToAssignOptions, HmrModuleHandler, type Initializeable, type InjectedEmojiMap, InteractionHandler, InteractionMiddleware, Middleware, type MiddlewareOptions, MiddlewareType, ModalRoute, type PermissionErrorCtors, Pluggable, Plugin, type PluginArgs, type PluginCtor, RegisterCommand, RegisterEvent, type RegisterEventOptions, type Repliables, RowComponent, type SavedEmojiType, Seedcord, SelectMenuRoute, SelectMenuType, SlashRoute, Subscribe, type SubscribeOptions, Subscriber, type SubscriptionData, type SubscriptionKey, type Subscriptions, type ValidEventTypes, type ValidInteractionTypes, type ValidNonInteractionKeys, WebhookLog, type WithChecks, attemptSendDM, buildSlashRoute, checkBotPermissions, checkPermissions, fetchGuildMember, fetchManyGuildMembers, fetchManyUsers, fetchRole, fetchText, fetchUser, getBotRole, hasPermsToAssign, sendInText, updateMemberRoles, version };
3774
+ export { type AllSubscriptions, AssignRoleErrorCtors, AutocompleteHandler, AutocompleteRoute, type BotEvents, type BotPermissionScope, BuilderComponent, type BuilderType, ButtonRoute, Catchable, type CatchableOptions, type CheckPermissionOptions, Checkable, CommandRouteString, Confirmable, type ConfirmableClassicOptions, type ConfirmableComponentsV2Options, type ConfirmableContext, type ConfirmableDecision, type ConfirmableDecisionByCustomIds, type ConfirmableDecisionByResolver, type ConfirmableFactory, type ConfirmableOptions, type ConfirmableOutcomeUiClassic, type ConfirmableOutcomeUiV2, type ConfirmableQuestionInput, type ConfirmableResolution, type ConfirmableSharedOptions, ContextMenuRoute, type Core, CustomError, Emojis, EventCatchable, type EventCatchableOptions, EventHandler, EventMiddleware, type EventSpec, HasPermsToAssignOptions, HmrModuleHandler, type Initializeable, type InjectedEmojiMap, InteractionHandler, InteractionMiddleware, Middleware, type MiddlewareOptions, MiddlewareType, ModalRoute, type PermissionErrorCtors, Pluggable, Plugin, type PluginArgs, type PluginCtor, RegisterCommand, RegisterEvent, type RegisterEventOptions, type Repliables, RowComponent, type RowType, type SavedEmojiType, Seedcord, SelectMenuRoute, SelectMenuType, SlashRoute, Subscribe, type SubscribeOptions, Subscriber, type SubscriptionData, type SubscriptionKey, type Subscriptions, type ValidEventTypes, type ValidInteractionTypes, type ValidNonInteractionKeys, WebhookLog, type WithChecks, attemptSendDM, buildSlashRoute, checkBotPermissions, checkPermissions, fetchGuildMember, fetchManyGuildMembers, fetchManyUsers, fetchRole, fetchText, fetchUser, getBotRole, hasPermsToAssign, sendInText, updateMemberRoles, version };
3775
3775
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as setBotColor, i as RowComponent, n as BuilderComponent, r as CustomError, t as DatabaseError } from "./Database-CqvL4DO2.mjs";
1
+ import { a as setBotColor, i as RowComponent, n as BuilderComponent, r as CustomError, t as DatabaseError } from "./Database-D-mgXwZ_.mjs";
2
2
  import "reflect-metadata";
3
3
  import { CoordinatedShutdown, CoordinatedStartup, HealthCheck, Logger, SeedcordErrorCode, ShutdownPhase, StartupPhase, StrictEventEmitter } from "@seedcord/services";
4
4
  import { SeedcordError, SeedcordTypeError } from "@seedcord/services/internal";
@@ -2964,7 +2964,7 @@ var Seedcord = class Seedcord extends Pluggable {
2964
2964
  //#endregion
2965
2965
  //#region src/index.ts
2966
2966
  /** Package version */
2967
- const version = "0.11.0";
2967
+ const version = "0.12.0-next.0";
2968
2968
 
2969
2969
  //#endregion
2970
2970
  export { AutocompleteHandler, AutocompleteRoute, BuilderComponent, ButtonRoute, Catchable, Checkable, Confirmable, ContextMenuRoute, CustomError, Emojis, EventCatchable, EventHandler, EventMiddleware, HmrModuleHandler, InteractionHandler, InteractionMiddleware, Middleware, MiddlewareType, ModalRoute, Pluggable, Plugin, RegisterCommand, RegisterEvent, RowComponent, Seedcord, SelectMenuRoute, SelectMenuType, SlashRoute, Subscribe, Subscriber, WebhookLog, attemptSendDM, buildSlashRoute, checkBotPermissions, checkPermissions, fetchGuildMember, fetchManyGuildMembers, fetchManyUsers, fetchRole, fetchText, fetchUser, getBotRole, hasPermsToAssign, sendInText, updateMemberRoles, version };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_Database = require('./Database-Xu_qxdiF.cjs');
2
+ const require_Database = require('./Database-Dx7bRFrY.cjs');
3
3
 
4
4
  exports.DatabaseError = require_Database.DatabaseError;
5
5
  var _seedcord_services_internal = require("@seedcord/services/internal");
@@ -1,4 +1,4 @@
1
- import { i as CustomError } from "./Components-D-AZ6ESx.mjs";
1
+ import { r as CustomError } from "./Components-BS8zPPq7.mjs";
2
2
  import { UUID } from "crypto";
3
3
  export * from "@seedcord/services/internal";
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as DatabaseError } from "./Database-CqvL4DO2.mjs";
1
+ import { t as DatabaseError } from "./Database-D-mgXwZ_.mjs";
2
2
 
3
3
  export * from "@seedcord/services/internal"
4
4
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "seedcord",
3
3
  "type": "module",
4
- "version": "0.11.0",
4
+ "version": "0.12.0-next.0",
5
5
  "description": "A Discord bot framework built on top of Discord.js",
6
6
  "repository": {
7
7
  "type": "git",
@@ -45,8 +45,8 @@
45
45
  "dependencies": {
46
46
  "chalk": "^5.6.2",
47
47
  "envapt": "^5.0.3",
48
- "@seedcord/types": "0.4.0",
49
48
  "@seedcord/utils": "0.4.0",
49
+ "@seedcord/types": "0.4.0",
50
50
  "@seedcord/services": "0.7.0",
51
51
  "@seedcord/cli": "0.1.0"
52
52
  },
@@ -56,8 +56,8 @@
56
56
  "type-fest": "^5.6.0",
57
57
  "vite": "^8.0.14",
58
58
  "@seedcord/eslint-config": "1.4.0",
59
- "@seedcord/tsconfig": "2.0.0",
60
- "@seedcord/tsdown-config": "2.0.0"
59
+ "@seedcord/tsdown-config": "2.0.0",
60
+ "@seedcord/tsconfig": "2.0.0"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public",
@@ -1 +0,0 @@
1
- {"version":3,"file":"Database-CqvL4DO2.mjs","names":[],"sources":["../src/miscellaneous/botColorHolder.ts","../src/interfaces/Components.ts","../src/bot/defaults/errors/Database.ts"],"sourcesContent":["import type { ColorResolvable } from 'discord.js';\n\n// 'Default' is Discord.js's own sentinel for \"no explicit color\".\nconst DEFAULT_COLOR: ColorResolvable = 'Default';\n\nlet current: ColorResolvable = DEFAULT_COLOR;\n\n/** @internal */\nexport function setBotColor(color: ColorResolvable | undefined): void {\n current = color ?? DEFAULT_COLOR;\n}\n\n/** @internal */\nexport function getBotColor(): ColorResolvable {\n return current;\n}\n","import {\n ActionRowBuilder,\n ButtonBuilder,\n ChannelSelectMenuBuilder,\n ContainerBuilder,\n ContextMenuCommandBuilder,\n EmbedBuilder,\n FileBuilder,\n FileUploadBuilder,\n InteractionContextType,\n LabelBuilder,\n MediaGalleryBuilder,\n MentionableSelectMenuBuilder,\n ModalBuilder,\n RoleSelectMenuBuilder,\n SectionBuilder,\n SeparatorBuilder,\n SlashCommandBuilder,\n SlashCommandSubcommandBuilder,\n SlashCommandSubcommandGroupBuilder,\n StringSelectMenuBuilder,\n StringSelectMenuOptionBuilder,\n TextDisplayBuilder,\n TextInputBuilder,\n UserSelectMenuBuilder,\n resolveColor\n} from 'discord.js';\n\nimport { getBotColor } from '@miscellaneous/botColorHolder';\n\nimport type { Join, NonEmptyTuple } from 'type-fest';\n\n/**\n * Available Discord.js builder classes for use with BuilderComponent\n *\n * @internal\n */\nexport const BuilderTypes = {\n // Command Components\n command: SlashCommandBuilder,\n context_menu: ContextMenuCommandBuilder,\n subcommand: SlashCommandSubcommandBuilder,\n group: SlashCommandSubcommandGroupBuilder,\n\n // Embed Components\n embed: EmbedBuilder,\n\n // Modal Components\n modal: ModalBuilder,\n label: LabelBuilder,\n text_input: TextInputBuilder,\n file_upload: FileUploadBuilder,\n\n // Action Row Components\n button: ButtonBuilder,\n menu_string: StringSelectMenuBuilder,\n menu_option_string: StringSelectMenuOptionBuilder,\n menu_user: UserSelectMenuBuilder,\n menu_channel: ChannelSelectMenuBuilder,\n menu_mentionable: MentionableSelectMenuBuilder,\n menu_role: RoleSelectMenuBuilder,\n\n // ComponentsV2\n container: ContainerBuilder,\n text_display: TextDisplayBuilder,\n file: FileBuilder,\n media: MediaGalleryBuilder,\n section: SectionBuilder,\n separator: SeparatorBuilder\n};\n\n/**\n * Available Discord.js action row classes for use with RowComponent\n *\n * @internal\n */\nexport const RowTypes: {\n button: typeof ActionRowBuilder<ButtonBuilder>;\n menu_string: typeof ActionRowBuilder<StringSelectMenuBuilder>;\n menu_user: typeof ActionRowBuilder<UserSelectMenuBuilder>;\n menu_channel: typeof ActionRowBuilder<ChannelSelectMenuBuilder>;\n menu_mentionable: typeof ActionRowBuilder<MentionableSelectMenuBuilder>;\n menu_role: typeof ActionRowBuilder<RoleSelectMenuBuilder>;\n} = {\n button: ActionRowBuilder<ButtonBuilder>,\n menu_string: ActionRowBuilder<StringSelectMenuBuilder>,\n menu_user: ActionRowBuilder<UserSelectMenuBuilder>,\n menu_channel: ActionRowBuilder<ChannelSelectMenuBuilder>,\n menu_mentionable: ActionRowBuilder<MentionableSelectMenuBuilder>,\n menu_role: ActionRowBuilder<RoleSelectMenuBuilder>\n};\n\n/**\n * Available Discord.js builder types for use with BuilderComponent\n */\nexport type BuilderType = keyof typeof BuilderTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedBuilder<BuilderKey extends BuilderType> = InstanceType<(typeof BuilderTypes)[BuilderKey]>;\n\n/**\n * Available Discord.js action row types for use with RowComponent\n */\nexport type ActionRowComponentType = keyof typeof RowTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedActionRow<RowKey extends ActionRowComponentType> = InstanceType<(typeof RowTypes)[RowKey]>;\n\n/**\n * Base class for Discord component wrappers\n *\n * Provides common functionality for building Discord components with proper typing.\n *\n * @typeParam TComponent - The Discord.js component type being wrapped\n *\n * @internal\n */\nexport abstract class BaseComponent<TComponent> {\n private readonly _component: TComponent;\n\n protected constructor(ComponentClass: new () => TComponent) {\n this._component = new ComponentClass();\n }\n\n /**\n * Gets the built component (should be considered read-only)\n *\n * Returns the finalized component ready for use in Discord messages.\n *\n * Please do not use for further configuration, use `this.instance` for that.\n * @example new SomeComponent().component\n */\n public abstract get component(): InstantiatedBuilder<BuilderType> | InstantiatedActionRow<ActionRowComponentType>;\n\n /**\n * Gets the component instance for configuration\n *\n * Use this to access Discord.js builder methods like setTitle(), setDescription(), etc.\n *\n * Use this in your component classes to configure the builder\n * @example this.instance.setTitle('My Modal')\n */\n protected get instance(): TComponent {\n return this._component;\n }\n\n /**\n * Builds a customId string for interactive components with no arguments\n *\n * @param prefix - The route prefix that handlers will match against\n * @returns The prefix as the customId\n */\n public buildCustomId<Prefix extends string>(prefix: Prefix): Prefix;\n /**\n * Builds a customId string for interactive components\n *\n * Creates customIds in the format `prefix:arg1-arg2-arg3` for buttons, modals, etc.\n * Arguments are joined with hyphens and separated from prefix with a colon.\n *\n * @param prefix - The route prefix that handlers will match against\n * @param args - Additional arguments to encode in the customId\n * @returns Formatted customId string\n */\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string>>(\n prefix: Prefix,\n ...args: Args\n ): `${Prefix}:${Join<Args, '-'>}`;\n\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string> | []>(\n prefix: Prefix,\n ...args: Args\n ): Prefix | `${Prefix}:${string}` {\n return args.length === 0 ? prefix : `${prefix}:${args.join('-')}`;\n }\n}\n\n/**\n * Base class for Discord.js builder components\n *\n * Wraps Discord.js builders (SlashCommandBuilder, EmbedBuilder, etc.) with\n * Seedcord-specific defaults and helper methods.\n *\n * @typeParam BuilderKey - The type of Discord.js builder being wrapped\n */\nexport abstract class BuilderComponent<BuilderKey extends BuilderType> extends BaseComponent<\n InstantiatedBuilder<BuilderKey>\n> {\n private colorApplied = false;\n\n protected constructor(public readonly type: BuilderKey) {\n const ComponentClass = BuilderTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedBuilder<BuilderKey>);\n\n if (this.instance instanceof SlashCommandBuilder || this.instance instanceof ContextMenuCommandBuilder) {\n this.instance.setContexts(InteractionContextType.Guild);\n }\n }\n\n get component(): InstantiatedBuilder<BuilderKey> {\n this.applyBotColor();\n return this.instance;\n }\n\n // Resolving in the constructor would capture the default for a component built before setBotColor()\n // ran. The unset check keeps a color the subclass set for itself.\n private applyBotColor(): void {\n if (this.colorApplied) return;\n this.colorApplied = true;\n\n const color = getBotColor();\n if (this.instance instanceof EmbedBuilder) {\n if (this.instance.data.color === undefined) this.instance.setColor(color);\n } else if (this.instance instanceof ContainerBuilder) {\n const accent = this.instance.data.accent_color;\n if (accent === null || accent === undefined) {\n this.instance.setAccentColor(color === 'Default' ? undefined : resolveColor(color));\n }\n }\n }\n}\n\n/**\n * Base class for Discord action row components\n *\n * Wraps Discord.js action row builder with Seedcord-specific defaults and helper methods.\n *\n * @typeParam RowKey - The Discord.js action row type being wrapped\n */\nexport abstract class RowComponent<RowKey extends ActionRowComponentType> extends BaseComponent<\n InstantiatedActionRow<RowKey>\n> {\n protected constructor(public readonly type: RowKey) {\n const ComponentClass = RowTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedActionRow<RowKey>);\n }\n\n get component(): InstantiatedActionRow<RowKey> {\n return this.instance;\n }\n}\n\n/**\n * Pre-configured error embed with default styling\n *\n * This is bundled in {@link CustomError}s as the response.\n *\n * @internal\n */\nexport class BaseErrorEmbed extends BuilderComponent<'embed'> {\n /**\n * Creates a new error embed with default configuration.\n */\n public constructor() {\n super('embed');\n this.instance.setTitle('Cannot Proceed');\n }\n}\n\n/**\n * Base class for custom error types with Discord embed responses\n *\n * Errors extending CustomError should be used with the `Catchable` decorators to implement a control flow. These errors will be caught and handled by the framework to show the user the configured response.\n */\nexport abstract class CustomError extends Error {\n private _emit = false;\n public readonly response = new BaseErrorEmbed().component;\n\n protected constructor(public override message: string) {\n super(message);\n\n Error.captureStackTrace(this, this.constructor);\n }\n\n /**\n * Whether this error should be emitted to logs\n *\n * Controls logging behavior. Errors with emit=true will always be logged,\n * while emit=false errors may be suppressed in production.\n *\n * @returns True if the error should be logged\n */\n public get emit(): boolean {\n return this._emit;\n }\n\n /**\n * Sets whether this error should be emitted to logs\n */\n public set emit(value: boolean) {\n this._emit = value;\n }\n}\n","import { CustomError } from '@interfaces/Components';\n\nimport type { UUID } from 'crypto';\n\n/**\n * Generic database operation error with UUID tracking.\n *\n * Thrown for various database operation failures and includes\n * a UUID for error tracking and debugging purposes.\n *\n * @internal\n */\nexport class DatabaseError extends CustomError {\n /**\n * Creates a new DatabaseError.\n *\n * @param message - The error message describing what went wrong\n * @param uuid - A unique identifier for this specific error instance\n */\n constructor(\n message: string,\n public uuid: UUID\n ) {\n super(message);\n this.emit = true; // Emit in logs regardless of environment\n this.name = 'DatabaseError';\n\n this.response\n .setTitle('Database Error')\n .setDescription(`An error occurred while interacting with the database.\\n### UUID: \\`${this.uuid}\\``);\n }\n}\n"],"mappings":";;;AAGA,MAAM,gBAAiC;AAEvC,IAAI,UAA2B;;AAG/B,SAAgB,YAAY,OAA0C;CAClE,UAAU,SAAS;AACvB;;AAGA,SAAgB,cAA+B;CAC3C,OAAO;AACX;;;;;;;;;ACsBA,MAAa,eAAe;CAExB,SAAS;CACT,cAAc;CACd,YAAY;CACZ,OAAO;CAGP,OAAO;CAGP,OAAO;CACP,OAAO;CACP,YAAY;CACZ,aAAa;CAGb,QAAQ;CACR,aAAa;CACb,oBAAoB;CACpB,WAAW;CACX,cAAc;CACd,kBAAkB;CAClB,WAAW;CAGX,WAAW;CACX,cAAc;CACd,MAAM;CACN,OAAO;CACP,SAAS;CACT,WAAW;AACf;;;;;;AAOA,MAAa,WAOT;CACA,QAAQ;CACR,aAAa;CACb,WAAW;CACX,cAAc;CACd,kBAAkB;CAClB,WAAW;AACf;;;;;;;;;;AA+BA,IAAsB,gBAAtB,MAAgD;CAC5C,AAAiB;CAEjB,AAAU,YAAY,gBAAsC;EACxD,KAAK,aAAa,IAAI,eAAe;CACzC;;;;;;;;;CAoBA,IAAc,WAAuB;EACjC,OAAO,KAAK;CAChB;CAwBA,AAAO,cACH,QACA,GAAG,MAC2B;EAC9B,OAAO,KAAK,WAAW,IAAI,SAAS,GAAG,OAAO,GAAG,KAAK,KAAK,GAAG;CAClE;AACJ;;;;;;;;;AAUA,IAAsB,mBAAtB,cAA+E,cAE7E;CAGwC;CAFtC,AAAQ,eAAe;CAEvB,AAAU,YAAY,AAAgB,MAAkB;EACpD,MAAM,iBAAiB,aAAa;EACpC,MAAM,cAA2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CAShC;;;;;;;CAFX,YACI,SACA,AAAO,MACT;EACE,MAAM,OAAO;EAFN;EAGP,KAAK,OAAO;EACZ,KAAK,OAAO;EAEZ,KAAK,SACA,SAAS,gBAAgB,EACzB,eAAe,uEAAuE,KAAK,KAAK,GAAG;CAC5G;AACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Database-Xu_qxdiF.cjs","names":["SlashCommandBuilder","ContextMenuCommandBuilder","SlashCommandSubcommandBuilder","SlashCommandSubcommandGroupBuilder","EmbedBuilder","ModalBuilder","LabelBuilder","TextInputBuilder","FileUploadBuilder","ButtonBuilder","StringSelectMenuBuilder","StringSelectMenuOptionBuilder","UserSelectMenuBuilder","ChannelSelectMenuBuilder","MentionableSelectMenuBuilder","RoleSelectMenuBuilder","ContainerBuilder","TextDisplayBuilder","FileBuilder","MediaGalleryBuilder","SectionBuilder","SeparatorBuilder","ActionRowBuilder","InteractionContextType"],"sources":["../src/miscellaneous/botColorHolder.ts","../src/interfaces/Components.ts","../src/bot/defaults/errors/Database.ts"],"sourcesContent":["import type { ColorResolvable } from 'discord.js';\n\n// 'Default' is Discord.js's own sentinel for \"no explicit color\".\nconst DEFAULT_COLOR: ColorResolvable = 'Default';\n\nlet current: ColorResolvable = DEFAULT_COLOR;\n\n/** @internal */\nexport function setBotColor(color: ColorResolvable | undefined): void {\n current = color ?? DEFAULT_COLOR;\n}\n\n/** @internal */\nexport function getBotColor(): ColorResolvable {\n return current;\n}\n","import {\n ActionRowBuilder,\n ButtonBuilder,\n ChannelSelectMenuBuilder,\n ContainerBuilder,\n ContextMenuCommandBuilder,\n EmbedBuilder,\n FileBuilder,\n FileUploadBuilder,\n InteractionContextType,\n LabelBuilder,\n MediaGalleryBuilder,\n MentionableSelectMenuBuilder,\n ModalBuilder,\n RoleSelectMenuBuilder,\n SectionBuilder,\n SeparatorBuilder,\n SlashCommandBuilder,\n SlashCommandSubcommandBuilder,\n SlashCommandSubcommandGroupBuilder,\n StringSelectMenuBuilder,\n StringSelectMenuOptionBuilder,\n TextDisplayBuilder,\n TextInputBuilder,\n UserSelectMenuBuilder,\n resolveColor\n} from 'discord.js';\n\nimport { getBotColor } from '@miscellaneous/botColorHolder';\n\nimport type { Join, NonEmptyTuple } from 'type-fest';\n\n/**\n * Available Discord.js builder classes for use with BuilderComponent\n *\n * @internal\n */\nexport const BuilderTypes = {\n // Command Components\n command: SlashCommandBuilder,\n context_menu: ContextMenuCommandBuilder,\n subcommand: SlashCommandSubcommandBuilder,\n group: SlashCommandSubcommandGroupBuilder,\n\n // Embed Components\n embed: EmbedBuilder,\n\n // Modal Components\n modal: ModalBuilder,\n label: LabelBuilder,\n text_input: TextInputBuilder,\n file_upload: FileUploadBuilder,\n\n // Action Row Components\n button: ButtonBuilder,\n menu_string: StringSelectMenuBuilder,\n menu_option_string: StringSelectMenuOptionBuilder,\n menu_user: UserSelectMenuBuilder,\n menu_channel: ChannelSelectMenuBuilder,\n menu_mentionable: MentionableSelectMenuBuilder,\n menu_role: RoleSelectMenuBuilder,\n\n // ComponentsV2\n container: ContainerBuilder,\n text_display: TextDisplayBuilder,\n file: FileBuilder,\n media: MediaGalleryBuilder,\n section: SectionBuilder,\n separator: SeparatorBuilder\n};\n\n/**\n * Available Discord.js action row classes for use with RowComponent\n *\n * @internal\n */\nexport const RowTypes: {\n button: typeof ActionRowBuilder<ButtonBuilder>;\n menu_string: typeof ActionRowBuilder<StringSelectMenuBuilder>;\n menu_user: typeof ActionRowBuilder<UserSelectMenuBuilder>;\n menu_channel: typeof ActionRowBuilder<ChannelSelectMenuBuilder>;\n menu_mentionable: typeof ActionRowBuilder<MentionableSelectMenuBuilder>;\n menu_role: typeof ActionRowBuilder<RoleSelectMenuBuilder>;\n} = {\n button: ActionRowBuilder<ButtonBuilder>,\n menu_string: ActionRowBuilder<StringSelectMenuBuilder>,\n menu_user: ActionRowBuilder<UserSelectMenuBuilder>,\n menu_channel: ActionRowBuilder<ChannelSelectMenuBuilder>,\n menu_mentionable: ActionRowBuilder<MentionableSelectMenuBuilder>,\n menu_role: ActionRowBuilder<RoleSelectMenuBuilder>\n};\n\n/**\n * Available Discord.js builder types for use with BuilderComponent\n */\nexport type BuilderType = keyof typeof BuilderTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedBuilder<BuilderKey extends BuilderType> = InstanceType<(typeof BuilderTypes)[BuilderKey]>;\n\n/**\n * Available Discord.js action row types for use with RowComponent\n */\nexport type ActionRowComponentType = keyof typeof RowTypes;\n\n/**\n * @internal\n */\nexport type InstantiatedActionRow<RowKey extends ActionRowComponentType> = InstanceType<(typeof RowTypes)[RowKey]>;\n\n/**\n * Base class for Discord component wrappers\n *\n * Provides common functionality for building Discord components with proper typing.\n *\n * @typeParam TComponent - The Discord.js component type being wrapped\n *\n * @internal\n */\nexport abstract class BaseComponent<TComponent> {\n private readonly _component: TComponent;\n\n protected constructor(ComponentClass: new () => TComponent) {\n this._component = new ComponentClass();\n }\n\n /**\n * Gets the built component (should be considered read-only)\n *\n * Returns the finalized component ready for use in Discord messages.\n *\n * Please do not use for further configuration, use `this.instance` for that.\n * @example new SomeComponent().component\n */\n public abstract get component(): InstantiatedBuilder<BuilderType> | InstantiatedActionRow<ActionRowComponentType>;\n\n /**\n * Gets the component instance for configuration\n *\n * Use this to access Discord.js builder methods like setTitle(), setDescription(), etc.\n *\n * Use this in your component classes to configure the builder\n * @example this.instance.setTitle('My Modal')\n */\n protected get instance(): TComponent {\n return this._component;\n }\n\n /**\n * Builds a customId string for interactive components with no arguments\n *\n * @param prefix - The route prefix that handlers will match against\n * @returns The prefix as the customId\n */\n public buildCustomId<Prefix extends string>(prefix: Prefix): Prefix;\n /**\n * Builds a customId string for interactive components\n *\n * Creates customIds in the format `prefix:arg1-arg2-arg3` for buttons, modals, etc.\n * Arguments are joined with hyphens and separated from prefix with a colon.\n *\n * @param prefix - The route prefix that handlers will match against\n * @param args - Additional arguments to encode in the customId\n * @returns Formatted customId string\n */\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string>>(\n prefix: Prefix,\n ...args: Args\n ): `${Prefix}:${Join<Args, '-'>}`;\n\n public buildCustomId<Prefix extends string, Args extends NonEmptyTuple<string> | []>(\n prefix: Prefix,\n ...args: Args\n ): Prefix | `${Prefix}:${string}` {\n return args.length === 0 ? prefix : `${prefix}:${args.join('-')}`;\n }\n}\n\n/**\n * Base class for Discord.js builder components\n *\n * Wraps Discord.js builders (SlashCommandBuilder, EmbedBuilder, etc.) with\n * Seedcord-specific defaults and helper methods.\n *\n * @typeParam BuilderKey - The type of Discord.js builder being wrapped\n */\nexport abstract class BuilderComponent<BuilderKey extends BuilderType> extends BaseComponent<\n InstantiatedBuilder<BuilderKey>\n> {\n private colorApplied = false;\n\n protected constructor(public readonly type: BuilderKey) {\n const ComponentClass = BuilderTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedBuilder<BuilderKey>);\n\n if (this.instance instanceof SlashCommandBuilder || this.instance instanceof ContextMenuCommandBuilder) {\n this.instance.setContexts(InteractionContextType.Guild);\n }\n }\n\n get component(): InstantiatedBuilder<BuilderKey> {\n this.applyBotColor();\n return this.instance;\n }\n\n // Resolving in the constructor would capture the default for a component built before setBotColor()\n // ran. The unset check keeps a color the subclass set for itself.\n private applyBotColor(): void {\n if (this.colorApplied) return;\n this.colorApplied = true;\n\n const color = getBotColor();\n if (this.instance instanceof EmbedBuilder) {\n if (this.instance.data.color === undefined) this.instance.setColor(color);\n } else if (this.instance instanceof ContainerBuilder) {\n const accent = this.instance.data.accent_color;\n if (accent === null || accent === undefined) {\n this.instance.setAccentColor(color === 'Default' ? undefined : resolveColor(color));\n }\n }\n }\n}\n\n/**\n * Base class for Discord action row components\n *\n * Wraps Discord.js action row builder with Seedcord-specific defaults and helper methods.\n *\n * @typeParam RowKey - The Discord.js action row type being wrapped\n */\nexport abstract class RowComponent<RowKey extends ActionRowComponentType> extends BaseComponent<\n InstantiatedActionRow<RowKey>\n> {\n protected constructor(public readonly type: RowKey) {\n const ComponentClass = RowTypes[type] as unknown;\n super(ComponentClass as new () => InstantiatedActionRow<RowKey>);\n }\n\n get component(): InstantiatedActionRow<RowKey> {\n return this.instance;\n }\n}\n\n/**\n * Pre-configured error embed with default styling\n *\n * This is bundled in {@link CustomError}s as the response.\n *\n * @internal\n */\nexport class BaseErrorEmbed extends BuilderComponent<'embed'> {\n /**\n * Creates a new error embed with default configuration.\n */\n public constructor() {\n super('embed');\n this.instance.setTitle('Cannot Proceed');\n }\n}\n\n/**\n * Base class for custom error types with Discord embed responses\n *\n * Errors extending CustomError should be used with the `Catchable` decorators to implement a control flow. These errors will be caught and handled by the framework to show the user the configured response.\n */\nexport abstract class CustomError extends Error {\n private _emit = false;\n public readonly response = new BaseErrorEmbed().component;\n\n protected constructor(public override message: string) {\n super(message);\n\n Error.captureStackTrace(this, this.constructor);\n }\n\n /**\n * Whether this error should be emitted to logs\n *\n * Controls logging behavior. Errors with emit=true will always be logged,\n * while emit=false errors may be suppressed in production.\n *\n * @returns True if the error should be logged\n */\n public get emit(): boolean {\n return this._emit;\n }\n\n /**\n * Sets whether this error should be emitted to logs\n */\n public set emit(value: boolean) {\n this._emit = value;\n }\n}\n","import { CustomError } from '@interfaces/Components';\n\nimport type { UUID } from 'crypto';\n\n/**\n * Generic database operation error with UUID tracking.\n *\n * Thrown for various database operation failures and includes\n * a UUID for error tracking and debugging purposes.\n *\n * @internal\n */\nexport class DatabaseError extends CustomError {\n /**\n * Creates a new DatabaseError.\n *\n * @param message - The error message describing what went wrong\n * @param uuid - A unique identifier for this specific error instance\n */\n constructor(\n message: string,\n public uuid: UUID\n ) {\n super(message);\n this.emit = true; // Emit in logs regardless of environment\n this.name = 'DatabaseError';\n\n this.response\n .setTitle('Database Error')\n .setDescription(`An error occurred while interacting with the database.\\n### UUID: \\`${this.uuid}\\``);\n }\n}\n"],"mappings":";;;AAGA,MAAM,gBAAiC;AAEvC,IAAI,UAA2B;;AAG/B,SAAgB,YAAY,OAA0C;CAClE,UAAU,SAAS;AACvB;;AAGA,SAAgB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