seedcord 0.2.1 → 0.3.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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Logger, CoordinatedShutdown, CoordinatedStartup, StartupPhase } from '@seedcord/services';
2
2
  export * from '@seedcord/services';
3
- import { ClientOptions, Guild, User, Client, ChatInputCommandInteraction, ButtonInteraction, ModalSubmitInteraction, AutocompleteInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction, ClientEvents, Events, AutocompleteFocusedOption, SlashCommandBuilder, EmbedBuilder, ButtonBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, ModalBuilder, ContextMenuCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ContainerBuilder, TextDisplayBuilder, FileBuilder, MediaGalleryBuilder, SectionBuilder, SeparatorBuilder, ActionRowBuilder, TextInputBuilder, WebhookClient } from 'discord.js';
3
+ import { ClientOptions, Guild, User, SlashCommandBuilder, ContextMenuCommandBuilder, Collection, Client, ChatInputCommandInteraction, ButtonInteraction, ModalSubmitInteraction, AutocompleteInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction, ClientEvents, Events, AutocompleteFocusedOption, EmbedBuilder, ButtonBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, ModalBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ContainerBuilder, TextDisplayBuilder, FileBuilder, MediaGalleryBuilder, SectionBuilder, SeparatorBuilder, ActionRowBuilder, TextInputBuilder, WebhookClient } from 'discord.js';
4
4
  import { Nullable, Tail, TypedConstructor, ConstructorFunction } from '@seedcord/types';
5
5
  export * from '@seedcord/types';
6
6
  import { UUID } from 'crypto';
@@ -14,6 +14,7 @@ interface InteractionsConfig {
14
14
  * Path to dir containing interaction handlers.
15
15
  */
16
16
  path: string;
17
+ ignoreCustomIds?: string[];
17
18
  }
18
19
  /**
19
20
  * Djs Events handlers
@@ -54,9 +55,41 @@ interface BotConfig {
54
55
  */
55
56
  clientOptions: ClientOptions;
56
57
  /**
57
- * Optional emoji mappings for the bot
58
+ * Optional emoji mappings. Pass an object with emojis mappings (e.g. below). These emojis will be loaded from the Application Emojis that you've uploaded via the Dev-Dashboard
59
+ *
60
+ * Key: The name of the object key you want to use in your codebase
61
+ *
62
+ * Value: The emoji identifier used in Discord
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const Emojis = {
67
+ * ThumbsUp: 'thumbsup',
68
+ * ThumbsDown: 'thumbsdown',
69
+ * Lol: 'lol_1',
70
+ * Kek: 'keklmao',
71
+ * };
72
+ * ```
73
+ *
74
+ * will turn into
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const Emojis = {
79
+ * ThumbsUp: '<:thumbsup:1872389747982323423>',
80
+ * ThumbsDown: '<:thumbsdown:1872389747982323424>',
81
+ * Lol: '<:lol_1:1872389747982323425>',
82
+ * Kek: '<a:keklmao:1872389747982323426>',
83
+ * };
84
+ * ```
58
85
  */
59
86
  emojis?: Record<string, string>;
87
+ /**
88
+ * Whether to show the error stack trace in the terminal in errors caught by the `@Catchable` decorator
89
+ *
90
+ * `false` by default
91
+ */
92
+ errorStack?: boolean;
60
93
  }
61
94
  /** Main configuration object for Seedcord bot */
62
95
  interface Config {
@@ -231,6 +264,28 @@ declare class Pluggable {
231
264
  attach<Key extends string, Ctor extends PluginCtor>(this: this, key: Key, Plugin: Ctor, startupPhase: StartupPhase, ...args: PluginArgs<Ctor>): this & Record<Key, InstanceType<Ctor>>;
232
265
  }
233
266
 
267
+ /**
268
+ * Manages Discord application command registration and deployment.
269
+ *
270
+ * Scans command directories, builds command structures, and handles both
271
+ * global and guild-specific command deployment to Discord's API.
272
+ *
273
+ * @internal
274
+ */
275
+ declare class CommandRegistry implements Initializeable {
276
+ private readonly core;
277
+ private readonly logger;
278
+ private isInitialised;
279
+ readonly globalCommands: (SlashCommandBuilder | ContextMenuCommandBuilder)[];
280
+ readonly guildCommands: Collection<string, (SlashCommandBuilder | ContextMenuCommandBuilder)[]>;
281
+ constructor(core: Core);
282
+ init(): Promise<void>;
283
+ private loadCommands;
284
+ private isCommandClass;
285
+ private registerCommand;
286
+ setCommands(): Promise<void>;
287
+ }
288
+
234
289
  /**
235
290
  * Discord bot implementation that manages client and controllers
236
291
  * @internal - Accessed via core.bot, not directly instantiated by users
@@ -243,7 +298,7 @@ declare class Bot extends Plugin {
243
298
  private readonly _client;
244
299
  private readonly interactions;
245
300
  private readonly events;
246
- private readonly commands;
301
+ readonly commands: CommandRegistry;
247
302
  private readonly emojiInjector;
248
303
  /**
249
304
  * @param core - Seedcord core instance
@@ -611,7 +666,7 @@ declare class BaseErrorEmbed extends BuilderComponent<'embed'> {
611
666
  */
612
667
  declare abstract class CustomError extends Error {
613
668
  message: string;
614
- protected _emit: boolean;
669
+ private _emit;
615
670
  readonly response: EmbedBuilder;
616
671
  protected constructor(message: string);
617
672
  /**
@@ -623,6 +678,12 @@ declare abstract class CustomError extends Error {
623
678
  * @returns True if the error should be logged
624
679
  */
625
680
  get emit(): boolean;
681
+ /**
682
+ * Sets whether this error should be emitted to logs
683
+ *
684
+ * @see {@link emit}
685
+ */
686
+ set emit(value: boolean);
626
687
  }
627
688
  /** Constructor type for custom error classes */
628
689
  type CustomErrorConstructor = new (message: string, ...args: any[]) => CustomError;
@@ -946,7 +1007,6 @@ declare abstract class WebhookLog<KeyOfEffects extends EffectKeys> extends Effec
946
1007
  */
947
1008
  declare class DatabaseError extends CustomError {
948
1009
  uuid: UUID;
949
- protected _emit: boolean;
950
1010
  /**
951
1011
  * Creates a new DatabaseError.
952
1012
  *
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Logger, CoordinatedShutdown, CoordinatedStartup, StartupPhase } from '@seedcord/services';
2
2
  export * from '@seedcord/services';
3
- import { ClientOptions, Guild, User, Client, ChatInputCommandInteraction, ButtonInteraction, ModalSubmitInteraction, AutocompleteInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction, ClientEvents, Events, AutocompleteFocusedOption, SlashCommandBuilder, EmbedBuilder, ButtonBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, ModalBuilder, ContextMenuCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ContainerBuilder, TextDisplayBuilder, FileBuilder, MediaGalleryBuilder, SectionBuilder, SeparatorBuilder, ActionRowBuilder, TextInputBuilder, WebhookClient } from 'discord.js';
3
+ import { ClientOptions, Guild, User, SlashCommandBuilder, ContextMenuCommandBuilder, Collection, Client, ChatInputCommandInteraction, ButtonInteraction, ModalSubmitInteraction, AutocompleteInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction, ClientEvents, Events, AutocompleteFocusedOption, EmbedBuilder, ButtonBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, ModalBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ContainerBuilder, TextDisplayBuilder, FileBuilder, MediaGalleryBuilder, SectionBuilder, SeparatorBuilder, ActionRowBuilder, TextInputBuilder, WebhookClient } from 'discord.js';
4
4
  import { Nullable, Tail, TypedConstructor, ConstructorFunction } from '@seedcord/types';
5
5
  export * from '@seedcord/types';
6
6
  import { UUID } from 'crypto';
@@ -14,6 +14,7 @@ interface InteractionsConfig {
14
14
  * Path to dir containing interaction handlers.
15
15
  */
16
16
  path: string;
17
+ ignoreCustomIds?: string[];
17
18
  }
18
19
  /**
19
20
  * Djs Events handlers
@@ -54,9 +55,41 @@ interface BotConfig {
54
55
  */
55
56
  clientOptions: ClientOptions;
56
57
  /**
57
- * Optional emoji mappings for the bot
58
+ * Optional emoji mappings. Pass an object with emojis mappings (e.g. below). These emojis will be loaded from the Application Emojis that you've uploaded via the Dev-Dashboard
59
+ *
60
+ * Key: The name of the object key you want to use in your codebase
61
+ *
62
+ * Value: The emoji identifier used in Discord
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const Emojis = {
67
+ * ThumbsUp: 'thumbsup',
68
+ * ThumbsDown: 'thumbsdown',
69
+ * Lol: 'lol_1',
70
+ * Kek: 'keklmao',
71
+ * };
72
+ * ```
73
+ *
74
+ * will turn into
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const Emojis = {
79
+ * ThumbsUp: '<:thumbsup:1872389747982323423>',
80
+ * ThumbsDown: '<:thumbsdown:1872389747982323424>',
81
+ * Lol: '<:lol_1:1872389747982323425>',
82
+ * Kek: '<a:keklmao:1872389747982323426>',
83
+ * };
84
+ * ```
58
85
  */
59
86
  emojis?: Record<string, string>;
87
+ /**
88
+ * Whether to show the error stack trace in the terminal in errors caught by the `@Catchable` decorator
89
+ *
90
+ * `false` by default
91
+ */
92
+ errorStack?: boolean;
60
93
  }
61
94
  /** Main configuration object for Seedcord bot */
62
95
  interface Config {
@@ -231,6 +264,28 @@ declare class Pluggable {
231
264
  attach<Key extends string, Ctor extends PluginCtor>(this: this, key: Key, Plugin: Ctor, startupPhase: StartupPhase, ...args: PluginArgs<Ctor>): this & Record<Key, InstanceType<Ctor>>;
232
265
  }
233
266
 
267
+ /**
268
+ * Manages Discord application command registration and deployment.
269
+ *
270
+ * Scans command directories, builds command structures, and handles both
271
+ * global and guild-specific command deployment to Discord's API.
272
+ *
273
+ * @internal
274
+ */
275
+ declare class CommandRegistry implements Initializeable {
276
+ private readonly core;
277
+ private readonly logger;
278
+ private isInitialised;
279
+ readonly globalCommands: (SlashCommandBuilder | ContextMenuCommandBuilder)[];
280
+ readonly guildCommands: Collection<string, (SlashCommandBuilder | ContextMenuCommandBuilder)[]>;
281
+ constructor(core: Core);
282
+ init(): Promise<void>;
283
+ private loadCommands;
284
+ private isCommandClass;
285
+ private registerCommand;
286
+ setCommands(): Promise<void>;
287
+ }
288
+
234
289
  /**
235
290
  * Discord bot implementation that manages client and controllers
236
291
  * @internal - Accessed via core.bot, not directly instantiated by users
@@ -243,7 +298,7 @@ declare class Bot extends Plugin {
243
298
  private readonly _client;
244
299
  private readonly interactions;
245
300
  private readonly events;
246
- private readonly commands;
301
+ readonly commands: CommandRegistry;
247
302
  private readonly emojiInjector;
248
303
  /**
249
304
  * @param core - Seedcord core instance
@@ -611,7 +666,7 @@ declare class BaseErrorEmbed extends BuilderComponent<'embed'> {
611
666
  */
612
667
  declare abstract class CustomError extends Error {
613
668
  message: string;
614
- protected _emit: boolean;
669
+ private _emit;
615
670
  readonly response: EmbedBuilder;
616
671
  protected constructor(message: string);
617
672
  /**
@@ -623,6 +678,12 @@ declare abstract class CustomError extends Error {
623
678
  * @returns True if the error should be logged
624
679
  */
625
680
  get emit(): boolean;
681
+ /**
682
+ * Sets whether this error should be emitted to logs
683
+ *
684
+ * @see {@link emit}
685
+ */
686
+ set emit(value: boolean);
626
687
  }
627
688
  /** Constructor type for custom error classes */
628
689
  type CustomErrorConstructor = new (message: string, ...args: any[]) => CustomError;
@@ -946,7 +1007,6 @@ declare abstract class WebhookLog<KeyOfEffects extends EffectKeys> extends Effec
946
1007
  */
947
1008
  declare class DatabaseError extends CustomError {
948
1009
  uuid: UUID;
949
- protected _emit: boolean;
950
1010
  /**
951
1011
  * Creates a new DatabaseError.
952
1012
  *
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Logger, CoordinatedShutdown, CoordinatedStartup, StartupPhase } from '@seedcord/services';
2
2
  export * from '@seedcord/services';
3
- import { ClientOptions, Guild, User, Client, ChatInputCommandInteraction, ButtonInteraction, ModalSubmitInteraction, AutocompleteInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction, ClientEvents, Events, AutocompleteFocusedOption, SlashCommandBuilder, EmbedBuilder, ButtonBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, ModalBuilder, ContextMenuCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ContainerBuilder, TextDisplayBuilder, FileBuilder, MediaGalleryBuilder, SectionBuilder, SeparatorBuilder, ActionRowBuilder, TextInputBuilder, WebhookClient } from 'discord.js';
3
+ import { ClientOptions, Guild, User, SlashCommandBuilder, ContextMenuCommandBuilder, Collection, Client, ChatInputCommandInteraction, ButtonInteraction, ModalSubmitInteraction, AutocompleteInteraction, AnySelectMenuInteraction, ContextMenuCommandInteraction, ClientEvents, Events, AutocompleteFocusedOption, EmbedBuilder, ButtonBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder, RoleSelectMenuBuilder, ModalBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ContainerBuilder, TextDisplayBuilder, FileBuilder, MediaGalleryBuilder, SectionBuilder, SeparatorBuilder, ActionRowBuilder, TextInputBuilder, WebhookClient } from 'discord.js';
4
4
  import { Nullable, Tail, TypedConstructor, ConstructorFunction } from '@seedcord/types';
5
5
  export * from '@seedcord/types';
6
6
  import { UUID } from 'crypto';
@@ -14,6 +14,7 @@ interface InteractionsConfig {
14
14
  * Path to dir containing interaction handlers.
15
15
  */
16
16
  path: string;
17
+ ignoreCustomIds?: string[];
17
18
  }
18
19
  /**
19
20
  * Djs Events handlers
@@ -54,9 +55,41 @@ interface BotConfig {
54
55
  */
55
56
  clientOptions: ClientOptions;
56
57
  /**
57
- * Optional emoji mappings for the bot
58
+ * Optional emoji mappings. Pass an object with emojis mappings (e.g. below). These emojis will be loaded from the Application Emojis that you've uploaded via the Dev-Dashboard
59
+ *
60
+ * Key: The name of the object key you want to use in your codebase
61
+ *
62
+ * Value: The emoji identifier used in Discord
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const Emojis = {
67
+ * ThumbsUp: 'thumbsup',
68
+ * ThumbsDown: 'thumbsdown',
69
+ * Lol: 'lol_1',
70
+ * Kek: 'keklmao',
71
+ * };
72
+ * ```
73
+ *
74
+ * will turn into
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const Emojis = {
79
+ * ThumbsUp: '<:thumbsup:1872389747982323423>',
80
+ * ThumbsDown: '<:thumbsdown:1872389747982323424>',
81
+ * Lol: '<:lol_1:1872389747982323425>',
82
+ * Kek: '<a:keklmao:1872389747982323426>',
83
+ * };
84
+ * ```
58
85
  */
59
86
  emojis?: Record<string, string>;
87
+ /**
88
+ * Whether to show the error stack trace in the terminal in errors caught by the `@Catchable` decorator
89
+ *
90
+ * `false` by default
91
+ */
92
+ errorStack?: boolean;
60
93
  }
61
94
  /** Main configuration object for Seedcord bot */
62
95
  interface Config {
@@ -231,6 +264,28 @@ declare class Pluggable {
231
264
  attach<Key extends string, Ctor extends PluginCtor>(this: this, key: Key, Plugin: Ctor, startupPhase: StartupPhase, ...args: PluginArgs<Ctor>): this & Record<Key, InstanceType<Ctor>>;
232
265
  }
233
266
 
267
+ /**
268
+ * Manages Discord application command registration and deployment.
269
+ *
270
+ * Scans command directories, builds command structures, and handles both
271
+ * global and guild-specific command deployment to Discord's API.
272
+ *
273
+ * @internal
274
+ */
275
+ declare class CommandRegistry implements Initializeable {
276
+ private readonly core;
277
+ private readonly logger;
278
+ private isInitialised;
279
+ readonly globalCommands: (SlashCommandBuilder | ContextMenuCommandBuilder)[];
280
+ readonly guildCommands: Collection<string, (SlashCommandBuilder | ContextMenuCommandBuilder)[]>;
281
+ constructor(core: Core);
282
+ init(): Promise<void>;
283
+ private loadCommands;
284
+ private isCommandClass;
285
+ private registerCommand;
286
+ setCommands(): Promise<void>;
287
+ }
288
+
234
289
  /**
235
290
  * Discord bot implementation that manages client and controllers
236
291
  * @internal - Accessed via core.bot, not directly instantiated by users
@@ -243,7 +298,7 @@ declare class Bot extends Plugin {
243
298
  private readonly _client;
244
299
  private readonly interactions;
245
300
  private readonly events;
246
- private readonly commands;
301
+ readonly commands: CommandRegistry;
247
302
  private readonly emojiInjector;
248
303
  /**
249
304
  * @param core - Seedcord core instance
@@ -611,7 +666,7 @@ declare class BaseErrorEmbed extends BuilderComponent<'embed'> {
611
666
  */
612
667
  declare abstract class CustomError extends Error {
613
668
  message: string;
614
- protected _emit: boolean;
669
+ private _emit;
615
670
  readonly response: EmbedBuilder;
616
671
  protected constructor(message: string);
617
672
  /**
@@ -623,6 +678,12 @@ declare abstract class CustomError extends Error {
623
678
  * @returns True if the error should be logged
624
679
  */
625
680
  get emit(): boolean;
681
+ /**
682
+ * Sets whether this error should be emitted to logs
683
+ *
684
+ * @see {@link emit}
685
+ */
686
+ set emit(value: boolean);
626
687
  }
627
688
  /** Constructor type for custom error classes */
628
689
  type CustomErrorConstructor = new (message: string, ...args: any[]) => CustomError;
@@ -946,7 +1007,6 @@ declare abstract class WebhookLog<KeyOfEffects extends EffectKeys> extends Effec
946
1007
  */
947
1008
  declare class DatabaseError extends CustomError {
948
1009
  uuid: UUID;
949
- protected _emit: boolean;
950
1010
  /**
951
1011
  * Creates a new DatabaseError.
952
1012
  *
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import 'reflect-metadata';
2
2
  import { Logger, ShutdownPhase, CoordinatedShutdown, CoordinatedStartup, HealthCheck, StartupPhase } from '@seedcord/services';
3
3
  export * from '@seedcord/services';
4
4
  import chalk2 from 'chalk';
5
- import { SeparatorBuilder, SectionBuilder, MediaGalleryBuilder, FileBuilder, TextDisplayBuilder, ContainerBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandBuilder, ContextMenuCommandBuilder, ModalBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, UserSelectMenuBuilder, StringSelectMenuOptionBuilder, StringSelectMenuBuilder, ButtonBuilder, EmbedBuilder, SlashCommandBuilder, InteractionContextType, ActionRowBuilder, TextInputBuilder, MessageFlags, Events, Client, WebhookClient, DiscordAPIError, SnowflakeUtil, Message } from 'discord.js';
5
+ import { SeparatorBuilder, SectionBuilder, MediaGalleryBuilder, FileBuilder, TextDisplayBuilder, ContainerBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandBuilder, ContextMenuCommandBuilder, ModalBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, UserSelectMenuBuilder, StringSelectMenuOptionBuilder, StringSelectMenuBuilder, ButtonBuilder, EmbedBuilder, SlashCommandBuilder, InteractionContextType, ActionRowBuilder, TextInputBuilder, Collection, MessageFlags, Events, Client, WebhookClient, DiscordAPIError, SnowflakeUtil, Message } from 'discord.js';
6
6
  import { Envapt } from 'envapt';
7
7
  import { traverseDirectory } from '@seedcord/utils';
8
8
  export * from '@seedcord/utils';
@@ -247,6 +247,14 @@ var CustomError = class extends Error {
247
247
  get emit() {
248
248
  return this._emit;
249
249
  }
250
+ /**
251
+ * Sets whether this error should be emitted to logs
252
+ *
253
+ * @see {@link emit}
254
+ */
255
+ set emit(value) {
256
+ this._emit = value;
257
+ }
250
258
  };
251
259
 
252
260
  // src/bot/decorators/CommandRegisterable.ts
@@ -273,7 +281,7 @@ var CommandRegistry = class {
273
281
  logger = new Logger("Commands");
274
282
  isInitialised = false;
275
283
  globalCommands = [];
276
- guildCommands = /* @__PURE__ */ new Map();
284
+ guildCommands = new Collection();
277
285
  constructor(core) {
278
286
  this.core = core;
279
287
  }
@@ -436,7 +444,7 @@ var EventController = class {
436
444
  core;
437
445
  logger = new Logger("Events");
438
446
  isInitialized = false;
439
- eventMap = /* @__PURE__ */ new Map();
447
+ eventMap = new Collection();
440
448
  constructor(core) {
441
449
  this.core = core;
442
450
  }
@@ -612,7 +620,6 @@ var DatabaseError = class extends CustomError {
612
620
  __name(this, "DatabaseError");
613
621
  }
614
622
  uuid;
615
- _emit = true;
616
623
  /**
617
624
  * Creates a new DatabaseError.
618
625
  *
@@ -621,6 +628,7 @@ var DatabaseError = class extends CustomError {
621
628
  */
622
629
  constructor(message, uuid) {
623
630
  super(message), this.uuid = uuid;
631
+ this.emit = true;
624
632
  this.name = "DatabaseError";
625
633
  this.response.setTitle("Database Error").setDescription(`An error occurred while interacting with the database.
626
634
  ### UUID: \`${this.uuid}\``);
@@ -664,7 +672,9 @@ var ErrorHandlingUtils = class {
664
672
  response: error.response
665
673
  };
666
674
  }
667
- this.logger.error(uuid, error);
675
+ const showStack = core.config.bot.errorStack;
676
+ if (showStack) this.logger.error(uuid, error);
677
+ else this.logger.error(`${uuid} | ${error.message}`);
668
678
  core.effects.emit("unknownException", {
669
679
  uuid,
670
680
  error,
@@ -775,24 +785,25 @@ var InteractionController = class {
775
785
  core;
776
786
  logger = new Logger("Interactions");
777
787
  isInitialized = false;
778
- slashMap = /* @__PURE__ */ new Map();
779
- buttonMap = /* @__PURE__ */ new Map();
780
- modalMap = /* @__PURE__ */ new Map();
781
- stringSelectMap = /* @__PURE__ */ new Map();
782
- userSelectMap = /* @__PURE__ */ new Map();
783
- roleSelectMap = /* @__PURE__ */ new Map();
784
- channelSelectMap = /* @__PURE__ */ new Map();
785
- mentionableSelectMap = /* @__PURE__ */ new Map();
786
- messageContextMenuMap = /* @__PURE__ */ new Map();
787
- userContextMenuMap = /* @__PURE__ */ new Map();
788
- autocompleteMap = /* @__PURE__ */ new Map();
789
- keysToIgnore = /* @__PURE__ */ new Set([
790
- "confirm!confirmable",
791
- "cancel!confirmable"
792
- ]);
788
+ slashMap = new Collection();
789
+ buttonMap = new Collection();
790
+ modalMap = new Collection();
791
+ stringSelectMap = new Collection();
792
+ userSelectMap = new Collection();
793
+ roleSelectMap = new Collection();
794
+ channelSelectMap = new Collection();
795
+ mentionableSelectMap = new Collection();
796
+ messageContextMenuMap = new Collection();
797
+ userContextMenuMap = new Collection();
798
+ autocompleteMap = new Collection();
799
+ keysToIgnore = /* @__PURE__ */ new Set();
793
800
  middlewares = [];
794
801
  constructor(core) {
795
802
  this.core = core;
803
+ const ignoredKeysFromConfig = this.core.config.bot.interactions.ignoreCustomIds;
804
+ if (ignoredKeysFromConfig) {
805
+ for (const ignoredKey of ignoredKeysFromConfig) this.keysToIgnore.add(ignoredKey);
806
+ }
796
807
  }
797
808
  async init() {
798
809
  if (this.isInitialized) return;
@@ -1211,6 +1222,7 @@ _ts_decorate4([
1211
1222
  Envapt("UNKNOWN_EXCEPTION_WEBHOOK_URL", {
1212
1223
  converter(raw, _fallback) {
1213
1224
  if (!raw) throw new Error("Missing UNKNOWN_EXCEPTION_WEBHOOK_URL");
1225
+ if (!URL.canParse(String(raw))) throw new Error("Invalid UNKNOWN_EXCEPTION_WEBHOOK_URL");
1214
1226
  return raw;
1215
1227
  }
1216
1228
  }),
@@ -1304,7 +1316,7 @@ var EffectsRegistry = class extends Plugin {
1304
1316
  core;
1305
1317
  logger = new Logger("Effects");
1306
1318
  isInitialized = false;
1307
- effectsMap = /* @__PURE__ */ new Map();
1319
+ effectsMap = new Collection();
1308
1320
  emitter = new EffectsEmitter();
1309
1321
  constructor(core) {
1310
1322
  super(core), this.core = core;