trivious 2.2.4 → 2.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.
Files changed (85) hide show
  1. package/dist/features/builders/utility.builders.js +8 -5
  2. package/dist/features/builders/utility.builders.js.map +1 -1
  3. package/dist/features/client/client.types.js +0 -2
  4. package/dist/features/client/client.types.js.map +1 -1
  5. package/dist/features/client/deploy.client.d.ts +1 -1
  6. package/dist/features/client/deploy.client.js +8 -9
  7. package/dist/features/client/deploy.client.js.map +1 -1
  8. package/dist/features/client/trivious.client.d.ts +1 -1
  9. package/dist/features/client/trivious.client.js +8 -9
  10. package/dist/features/client/trivious.client.js.map +1 -1
  11. package/dist/features/commands/builders.commands.d.ts +5 -5
  12. package/dist/features/commands/builders.commands.js +10 -5
  13. package/dist/features/commands/builders.commands.js.map +1 -1
  14. package/dist/features/commands/commands.types.d.ts +1 -1
  15. package/dist/features/commands/commands.types.js +0 -2
  16. package/dist/features/commands/commands.types.js.map +1 -1
  17. package/dist/features/commands/methods.commands.d.ts +1 -1
  18. package/dist/features/commands/methods.commands.js +4 -3
  19. package/dist/features/commands/methods.commands.js.map +1 -1
  20. package/dist/features/commands/registry.commands.d.ts +1 -1
  21. package/dist/features/commands/registry.commands.js +92 -79
  22. package/dist/features/commands/registry.commands.js.map +1 -1
  23. package/dist/features/components/builders.components.d.ts +1 -1
  24. package/dist/features/components/builders.components.js +7 -5
  25. package/dist/features/components/builders.components.js.map +1 -1
  26. package/dist/features/components/components.types.d.ts +1 -1
  27. package/dist/features/components/components.types.js +3 -3
  28. package/dist/features/components/components.types.js.map +1 -1
  29. package/dist/features/components/registry.components.d.ts +1 -1
  30. package/dist/features/components/registry.components.js +9 -10
  31. package/dist/features/components/registry.components.js.map +1 -1
  32. package/dist/features/customId/customid.types.d.ts +1 -1
  33. package/dist/features/customId/customid.types.js +0 -2
  34. package/dist/features/customId/customid.types.js.map +1 -1
  35. package/dist/features/customId/methods.customid.d.ts +1 -1
  36. package/dist/features/customId/methods.customid.js +4 -5
  37. package/dist/features/customId/methods.customid.js.map +1 -1
  38. package/dist/features/events/builders.events.d.ts +1 -1
  39. package/dist/features/events/builders.events.js +4 -3
  40. package/dist/features/events/builders.events.js.map +1 -1
  41. package/dist/features/events/events.types.d.ts +1 -1
  42. package/dist/features/events/events.types.js +0 -2
  43. package/dist/features/events/events.types.js.map +1 -1
  44. package/dist/features/events/presets/clientReady.d.ts +1 -1
  45. package/dist/features/events/presets/clientReady.js +3 -3
  46. package/dist/features/events/presets/clientReady.js.map +1 -1
  47. package/dist/features/events/presets/interactionCreate.d.ts +1 -1
  48. package/dist/features/events/presets/interactionCreate.js +14 -9
  49. package/dist/features/events/presets/interactionCreate.js.map +1 -1
  50. package/dist/features/events/registry.events.d.ts +1 -1
  51. package/dist/features/events/registry.events.js +10 -10
  52. package/dist/features/events/registry.events.js.map +1 -1
  53. package/dist/features/modules/builders.modules.d.ts +1 -1
  54. package/dist/features/modules/builders.modules.js +3 -3
  55. package/dist/features/modules/builders.modules.js.map +1 -1
  56. package/dist/features/modules/modules.types.d.ts +1 -1
  57. package/dist/features/modules/modules.types.js +0 -2
  58. package/dist/features/modules/modules.types.js.map +1 -1
  59. package/dist/features/modules/registry.modules.d.ts +1 -1
  60. package/dist/features/modules/registry.modules.js +9 -9
  61. package/dist/features/modules/registry.modules.js.map +1 -1
  62. package/dist/features/permissions/methods.permissions.d.ts +1 -1
  63. package/dist/features/permissions/methods.permissions.js +4 -3
  64. package/dist/features/permissions/methods.permissions.js.map +1 -1
  65. package/dist/features/permissions/permissions.types.d.ts +1 -3
  66. package/dist/features/permissions/permissions.types.js +0 -2
  67. package/dist/features/permissions/permissions.types.js.map +1 -1
  68. package/dist/features/structure/index.structure.js +11 -12
  69. package/dist/features/structure/index.structure.js.map +1 -1
  70. package/dist/index.d.ts +1 -1
  71. package/dist/index.js +11 -9
  72. package/dist/index.js.map +1 -1
  73. package/dist/{modules.types-lYoNHt-m.d.ts → modules.types-STECtgbF.d.ts} +12 -6
  74. package/dist/shared/registries.d.ts +1 -1
  75. package/dist/shared/registries.js +7 -8
  76. package/dist/shared/registries.js.map +1 -1
  77. package/dist/shared/typings.d.ts +1 -1
  78. package/dist/shared/typings.js +11 -9
  79. package/dist/shared/typings.js.map +1 -1
  80. package/dist/utility/errors.d.ts +1 -1
  81. package/dist/utility/errors.js +4 -3
  82. package/dist/utility/errors.js.map +1 -1
  83. package/dist/utility/functions.js +7 -7
  84. package/dist/utility/functions.js.map +1 -1
  85. package/package.json +9 -5
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
- export * from './shared/typings.js';
2
- export * from './features/builders/utility.builders.js';
3
- export * from './features/commands/methods.commands.js';
4
- export { default as customId } from './features/customId/methods.customid.js';
5
- export * from './features/commands/builders.commands.js';
6
- export * from './features/components/builders.components.js';
7
- export * from './features/events/builders.events.js';
8
- export * from './features/modules/builders.modules.js';
9
- //# sourceMappingURL=index.js.map
1
+ export * from "./shared/typings.js";
2
+ export * from "./features/builders/utility.builders.js";
3
+ export * from "./features/commands/methods.commands.js";
4
+ import { default as default2 } from "./features/customId/methods.customid.js";
5
+ export * from "./features/commands/builders.commands.js";
6
+ export * from "./features/components/builders.components.js";
7
+ export * from "./features/events/builders.events.js";
8
+ export * from "./features/modules/builders.modules.js";
9
+ export {
10
+ default2 as customId
11
+ };
10
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"@typings\";\n\n// Methods\nexport * from \"@feature/builders/utility.builders.js\";\nexport * from \"@feature/commands/methods.commands.js\";\nexport { default as customId } from \"@feature/customId/methods.customid.js\";\n\n// Builders\nexport * from \"@feature/commands/builders.commands.js\";\nexport * from \"@feature/components/builders.components.js\";\nexport * from \"@feature/events/builders.events.js\";\nexport * from \"@feature/modules/builders.modules.js\";\n"],"mappings":"AACA,cAAc;AAGd,cAAc;AACd,cAAc;AACd,SAAoB,WAAXA,gBAA2B;AAGpC,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":["default"]}
@@ -1,4 +1,4 @@
1
- import { Client, Collection, ApplicationCommandType, Interaction, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandBuilder, ChatInputCommandInteraction, SlashCommandSubcommandGroupBuilder, ContextMenuCommandBuilder, MessageContextMenuCommandInteraction, UserContextMenuCommandInteraction, ButtonInteraction, AnySelectMenuInteraction, ModalSubmitInteraction, ClientEvents } from 'discord.js';
1
+ import { Client, Collection, ApplicationCommandType, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandBuilder, Interaction, ContextMenuCommandBuilder, MessageContextMenuCommandInteraction, UserContextMenuCommandInteraction, ChatInputCommandInteraction, SlashCommandSubcommandGroupBuilder, ButtonInteraction, AnySelectMenuInteraction, ModalSubmitInteraction, ClientEvents } from 'discord.js';
2
2
  import { TriviousClientOptions } from './features/client/client.types.js';
3
3
  import { CommandPermissionValues } from './features/permissions/permissions.types.js';
4
4
 
@@ -73,7 +73,7 @@ interface ContextCommandData<T extends "Message" | "User" | null = null> extends
73
73
  interface SlashCommandData extends BaseChatInputCommandData {
74
74
  context: "SlashCommand";
75
75
  data: SlashCommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandsOnlyBuilder;
76
- subcommands?: Collection<string, SlashSubcommandData<"command", true>>;
76
+ subcommands?: Collection<string, SlashSubcommandData<true>>;
77
77
  subcommandGroups?: Collection<string, SlashSubcommandGroupData<true>>;
78
78
  run?: CommandFunction<ChatInputCommandInteraction>;
79
79
  }
@@ -86,7 +86,7 @@ interface SlashCommandData extends BaseChatInputCommandData {
86
86
  interface SlashSubcommandGroupData<Processed extends boolean = false> {
87
87
  context: "SlashSubcommandGroup";
88
88
  data: SlashCommandSubcommandGroupBuilder;
89
- subcommands: Collection<string, SlashSubcommandData<"group", boolean>>;
89
+ subcommands: Collection<string, SlashSubcommandData>;
90
90
  parent?: Processed extends true ? SlashCommandData : SlashCommandData | undefined;
91
91
  }
92
92
  /**
@@ -97,12 +97,18 @@ interface SlashSubcommandGroupData<Processed extends boolean = false> {
97
97
  * @param data The slash subcommand builder
98
98
  * @param execute Function for when the subcommand is executed
99
99
  */
100
- interface SlashSubcommandData<Parent extends "command" | "group" = "command", Processed extends boolean = false> extends BaseChatInputCommandData {
100
+ interface SlashSubcommandData<Processed extends boolean = false> extends BaseChatInputCommandData {
101
101
  context: "SlashSubcommand";
102
102
  data: SlashCommandSubcommandBuilder;
103
103
  execute: CommandFunction<ChatInputCommandInteraction>;
104
- parent?: Processed extends true ? Parent extends "command" ? SlashCommandData : SlashSubcommandGroupData<true> : Parent extends "command" ? SlashCommandData | undefined : SlashSubcommandGroupData<false> | undefined;
104
+ parent?: Processed extends true ? SlashCommandData | SlashSubcommandGroupData<true> : SlashCommandData | SlashSubcommandGroupData<false>;
105
105
  }
106
+ type CommandSetData<Data> = [Data, directory: string];
107
+ type CollatedCommandData = {
108
+ SlashCommand: Set<CommandSetData<SlashCommandData>>;
109
+ SlashSubcommand: Set<CommandSetData<SlashSubcommandData>>;
110
+ SlashSubcommandGroup: Set<CommandSetData<SlashSubcommandGroupData>>;
111
+ };
106
112
 
107
113
  type ComponentFlags = "Cached" | "DeferReply" | "EphemeralReply" | "ExpectModal";
108
114
  type ComponentInteraction = AnySelectMenuInteraction | ButtonInteraction | ModalSubmitInteraction;
@@ -144,4 +150,4 @@ interface Module {
144
150
  };
145
151
  }
146
152
 
147
- export { type BaseChatInputCommandData as B, type ChatInputCommandContext as C, type Event as E, type Module as M, type SlashCommandData as S, TriviousClient as T, type BaseCommandData as a, type CommandFlags as b, type CommandFunction as c, type Component as d, ComponentContext as e, type ComponentFlags as f, type ComponentInteraction as g, type ContextCommandData as h, type SlashSubcommandData as i, type SlashSubcommandGroupData as j };
153
+ export { type BaseChatInputCommandData as B, type ChatInputCommandContext as C, type Event as E, type Module as M, type SlashCommandData as S, TriviousClient as T, type BaseCommandData as a, type CollatedCommandData as b, type CommandFlags as c, type CommandFunction as d, type CommandSetData as e, type Component as f, ComponentContext as g, type ComponentFlags as h, type ComponentInteraction as i, type ContextCommandData as j, type SlashSubcommandData as k, type SlashSubcommandGroupData as l };
@@ -2,7 +2,7 @@ import registerCommands from '../features/commands/registry.commands.js';
2
2
  import registerComponents from '../features/components/registry.components.js';
3
3
  import registerEvents, { bindEvents } from '../features/events/registry.events.js';
4
4
  import registerModules, { bindModules } from '../features/modules/registry.modules.js';
5
- import '../modules.types-lYoNHt-m.js';
5
+ import '../modules.types-STECtgbF.js';
6
6
  import 'discord.js';
7
7
  import '../features/client/client.types.js';
8
8
  import '../features/permissions/permissions.types.js';
@@ -1,8 +1,7 @@
1
- import registerCommands from '../features/commands/registry.commands.js';
2
- import registerComponents from '../features/components/registry.components.js';
3
- import registerEvents, { bindEvents } from '../features/events/registry.events.js';
4
- import registerModules, { bindModules } from '../features/modules/registry.modules.js';
5
-
1
+ import registerCommands from "../features/commands/registry.commands.js";
2
+ import registerComponents from "../features/components/registry.components.js";
3
+ import registerEvents, { bindEvents } from "../features/events/registry.events.js";
4
+ import registerModules, { bindModules } from "../features/modules/registry.modules.js";
6
5
  var registries_default = {
7
6
  commands: {
8
7
  register: registerCommands
@@ -19,7 +18,7 @@ var registries_default = {
19
18
  bind: bindModules
20
19
  }
21
20
  };
22
-
23
- export { registries_default as default };
24
- //# sourceMappingURL=registries.js.map
21
+ export {
22
+ registries_default as default
23
+ };
25
24
  //# sourceMappingURL=registries.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/registries.ts"],"names":[],"mappings":";;;;;AAKA,IAAO,kBAAA,GAAQ;AAAA,EACd,QAAA,EAAU;AAAA,IACT,QAAA,EAAU;AAAA,GACX;AAAA,EACA,UAAA,EAAY;AAAA,IACX,QAAA,EAAU;AAAA,GACX;AAAA,EACA,MAAA,EAAQ;AAAA,IACP,QAAA,EAAU,cAAA;AAAA,IACV,IAAA,EAAM;AAAA,GACP;AAAA,EACA,OAAA,EAAS;AAAA,IACR,QAAA,EAAU,eAAA;AAAA,IACV,IAAA,EAAM;AAAA;AAER","file":"registries.js","sourcesContent":["import registerCommands from \"src/features/commands/registry.commands.js\";\nimport registerComponents from \"src/features/components/registry.components.js\";\nimport registerEvents, { bindEvents } from \"src/features/events/registry.events.js\";\nimport registerModules, { bindModules } from \"src/features/modules/registry.modules.js\";\n\nexport default {\n\tcommands: {\n\t\tregister: registerCommands,\n\t},\n\tcomponents: {\n\t\tregister: registerComponents,\n\t},\n\tevents: {\n\t\tregister: registerEvents,\n\t\tbind: bindEvents,\n\t},\n\tmodules: {\n\t\tregister: registerModules,\n\t\tbind: bindModules,\n\t},\n} as const;\n"]}
1
+ {"version":3,"sources":["../../src/shared/registries.ts"],"sourcesContent":["import registerCommands from \"@feature/commands/registry.commands.js\";\nimport registerComponents from \"@feature/components/registry.components.js\";\nimport registerEvents, { bindEvents } from \"@feature/events/registry.events.js\";\nimport registerModules, { bindModules } from \"@feature/modules/registry.modules.js\";\n\nexport default {\n\tcommands: {\n\t\tregister: registerCommands,\n\t},\n\tcomponents: {\n\t\tregister: registerComponents,\n\t},\n\tevents: {\n\t\tregister: registerEvents,\n\t\tbind: bindEvents,\n\t},\n\tmodules: {\n\t\tregister: registerModules,\n\t\tbind: bindModules,\n\t},\n} as const;\n"],"mappings":"AAAA,OAAO,sBAAsB;AAC7B,OAAO,wBAAwB;AAC/B,OAAO,kBAAkB,kBAAkB;AAC3C,OAAO,mBAAmB,mBAAmB;AAE7C,IAAO,qBAAQ;AAAA,EACd,UAAU;AAAA,IACT,UAAU;AAAA,EACX;AAAA,EACA,YAAY;AAAA,IACX,UAAU;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,EACP;AAAA,EACA,SAAS;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,EACP;AACD;","names":[]}
@@ -1,5 +1,5 @@
1
1
  export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from '../features/client/client.types.js';
2
- export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CommandFlags, c as CommandFunction, d as Component, e as ComponentContext, f as ComponentFlags, g as ComponentInteraction, h as ContextCommandData, E as Event, M as Module, S as SlashCommandData, i as SlashSubcommandData, j as SlashSubcommandGroupData, T as TriviousClient } from '../modules.types-lYoNHt-m.js';
2
+ export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CollatedCommandData, c as CommandFlags, d as CommandFunction, e as CommandSetData, f as Component, g as ComponentContext, h as ComponentFlags, i as ComponentInteraction, j as ContextCommandData, E as Event, M as Module, S as SlashCommandData, k as SlashSubcommandData, l as SlashSubcommandGroupData, T as TriviousClient } from '../modules.types-STECtgbF.js';
3
3
  export { ComponentCustomId, ComponentTag } from '../features/customId/customid.types.js';
4
4
  export { CommandPermissionValues } from '../features/permissions/permissions.types.js';
5
5
  import 'discord.js';
@@ -1,10 +1,12 @@
1
- export * from '../features/client/client.types.js';
2
- export { default as TriviousClient } from '../features/client/trivious.client.js';
3
- export * from '../features/commands/commands.types.js';
4
- export * from '../features/components/components.types.js';
5
- export * from '../features/customId/customid.types.js';
6
- export * from '../features/events/events.types.js';
7
- export * from '../features/modules/modules.types.js';
8
- export * from '../features/permissions/permissions.types.js';
9
- //# sourceMappingURL=typings.js.map
1
+ export * from "../features/client/client.types.js";
2
+ import { default as default2 } from "../features/client/trivious.client.js";
3
+ export * from "../features/commands/commands.types.js";
4
+ export * from "../features/components/components.types.js";
5
+ export * from "../features/customId/customid.types.js";
6
+ export * from "../features/events/events.types.js";
7
+ export * from "../features/modules/modules.types.js";
8
+ export * from "../features/permissions/permissions.types.js";
9
+ export {
10
+ default2 as TriviousClient
11
+ };
10
12
  //# sourceMappingURL=typings.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"typings.js","sourcesContent":[]}
1
+ {"version":3,"sources":["../../src/shared/typings.ts"],"sourcesContent":["export * from \"@feature/client/client.types.js\";\nexport { default as TriviousClient } from \"@feature/client/trivious.client.js\";\nexport * from \"@feature/commands/commands.types.js\";\nexport * from \"@feature/components/components.types.js\";\nexport * from \"@feature/customId/customid.types.js\";\nexport * from \"@feature/events/events.types.js\";\nexport * from \"@feature/modules/modules.types.js\";\nexport * from \"@feature/permissions/permissions.types.js\";\n"],"mappings":"AAAA,cAAc;AACd,SAAoB,WAAXA,gBAAiC;AAC1C,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":["default"]}
@@ -1,4 +1,4 @@
1
- import { a as BaseCommandData, S as SlashCommandData } from '../modules.types-lYoNHt-m.js';
1
+ import { a as BaseCommandData, S as SlashCommandData } from '../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../features/client/client.types.js';
4
4
  import '../features/permissions/permissions.types.js';
@@ -18,7 +18,8 @@ class CommandError extends Error {
18
18
  if ("data" in command) this.commandName = command.data?.name;
19
19
  }
20
20
  }
21
-
22
- export { CommandError, TriviousError };
23
- //# sourceMappingURL=errors.js.map
21
+ export {
22
+ CommandError,
23
+ TriviousError
24
+ };
24
25
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utility/errors.ts"],"names":[],"mappings":"AAEO,MAAM,sBAAsB,KAAA,CAAM;AAAA,EAC/B,KAAA;AAAA,EACA,KAAA;AAAA,EAET,WAAA,CAAY,SAAiB,KAAA,EAAgB;AAC5C,IAAA,OAAA,GAAU,cAAc,OAAO,CAAA,CAAA;AAC/B,IAAA,KAAA,CAAM,OAAO,CAAA;AAEb,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AAAA,EACb;AACD;AAEO,MAAM,qBAAqB,KAAA,CAAM;AAAA,EAC9B,WAAA;AAAA,EAET,WAAA,CAAY,SAAiB,OAAA,EAAsD;AAClF,IAAA,OAAA,GAAU,cAAc,OAAO,CAAA,CAAA;AAC/B,IAAA,KAAA,CAAM,OAAO,CAAA;AAEb,IAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AAEZ,IAAA,IAAI,MAAA,IAAU,OAAA,EAAS,IAAA,CAAK,WAAA,GAAc,QAAQ,IAAA,EAAM,IAAA;AAAA,EAGzD;AACD","file":"errors.js","sourcesContent":["import { BaseCommandData, SlashCommandData } from \"src/features/commands/commands.types.js\";\n\nexport class TriviousError extends Error {\n\treadonly field?: string;\n\treadonly cause?: string;\n\n\tconstructor(message: string, cause?: string) {\n\t\tmessage = `[Trivious] ${message}`;\n\t\tsuper(message);\n\n\t\tthis.message = message;\n\t\tthis.cause = cause;\n\t\tthis.name = \"TriviousError\";\n\t}\n}\n\nexport class CommandError extends Error {\n\treadonly commandName?: string;\n\n\tconstructor(message: string, command: Partial<BaseCommandData | SlashCommandData>) {\n\t\tmessage = `[Trivious] ${message}`;\n\t\tsuper(message);\n\n\t\tthis.name = \"CommandError\";\n\n\t\tif (\"data\" in command) this.commandName = command.data?.name;\n\t\t// if (this.commandContext && this.commandName)\n\t\t// \tthis.cause = `Error in ${this.commandContext} '${this.commandName}'`;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../src/utility/errors.ts"],"sourcesContent":["import { BaseCommandData, SlashCommandData } from \"@feature/commands/commands.types.js\";\n\nexport class TriviousError extends Error {\n\treadonly field?: string;\n\treadonly cause?: string;\n\n\tconstructor(message: string, cause?: string) {\n\t\tmessage = `[Trivious] ${message}`;\n\t\tsuper(message);\n\n\t\tthis.message = message;\n\t\tthis.cause = cause;\n\t\tthis.name = \"TriviousError\";\n\t}\n}\n\nexport class CommandError extends Error {\n\treadonly commandName?: string;\n\n\tconstructor(message: string, command: Partial<BaseCommandData | SlashCommandData>) {\n\t\tmessage = `[Trivious] ${message}`;\n\t\tsuper(message);\n\n\t\tthis.name = \"CommandError\";\n\n\t\tif (\"data\" in command) this.commandName = command.data?.name;\n\t\t// if (this.commandContext && this.commandName)\n\t\t// \tthis.cause = `Error in ${this.commandContext} '${this.commandName}'`;\n\t}\n}\n"],"mappings":"AAEO,MAAM,sBAAsB,MAAM;AAAA,EAC/B;AAAA,EACA;AAAA,EAET,YAAY,SAAiB,OAAgB;AAC5C,cAAU,cAAc,OAAO;AAC/B,UAAM,OAAO;AAEb,SAAK,UAAU;AACf,SAAK,QAAQ;AACb,SAAK,OAAO;AAAA,EACb;AACD;AAEO,MAAM,qBAAqB,MAAM;AAAA,EAC9B;AAAA,EAET,YAAY,SAAiB,SAAsD;AAClF,cAAU,cAAc,OAAO;AAC/B,UAAM,OAAO;AAEb,SAAK,OAAO;AAEZ,QAAI,UAAU,QAAS,MAAK,cAAc,QAAQ,MAAM;AAAA,EAGzD;AACD;","names":[]}
@@ -1,6 +1,5 @@
1
- import { promises } from 'fs';
2
- import { pathToFileURL } from 'url';
3
-
1
+ import { promises as fs } from "fs";
2
+ import { pathToFileURL } from "url";
4
3
  async function importFile(filePath) {
5
4
  try {
6
5
  const { default: file } = await import(pathToFileURL(filePath).href);
@@ -20,13 +19,14 @@ async function importFile(filePath) {
20
19
  }
21
20
  async function exists(path) {
22
21
  try {
23
- await promises.access(path);
22
+ await fs.access(path);
24
23
  return true;
25
24
  } catch {
26
25
  return false;
27
26
  }
28
27
  }
29
-
30
- export { exists, importFile };
31
- //# sourceMappingURL=functions.js.map
28
+ export {
29
+ exists,
30
+ importFile
31
+ };
32
32
  //# sourceMappingURL=functions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utility/functions.ts"],"names":["fs"],"mappings":";;;AAGA,eAAsB,WAAc,QAAA,EAAqC;AACxE,EAAA,IAAI;AACH,IAAA,MAAM,EAAE,SAAS,IAAA,EAAK,GAAI,MAAM,OAAO,aAAA,CAAc,QAAQ,CAAA,CAAE,IAAA,CAAA;AAC/D,IAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAElB,IAAA,MAAM,OAAA,GAAU,KAAK,OAAA,IAAW,IAAA;AAEhC,IAAA,IAAI,OAAO,OAAA,KAAY,UAAA,IAAc,OAAA,CAAQ,SAAA,EAAW;AACvD,MAAA,OAAO,IAAI,OAAA,EAAQ;AAAA,IACpB;AAEA,IAAA,IAAI,OAAO,WAAW,QAAA,EAAU;AAC/B,MAAA,IAAI,OAAO,IAAA,CAAK,OAAO,CAAA,CAAE,MAAA,KAAW,GAAG,OAAO,IAAA;AAC9C,MAAA,OAAO,OAAA;AAAA,IACR;AAEA,IAAA,OAAO,IAAA;AAAA,EACR,CAAA,CAAA,MAAQ;AACP,IAAA,OAAO,IAAA;AAAA,EACR;AACD;AAEA,eAAsB,OAAO,IAAA,EAAc;AAC1C,EAAA,IAAI;AACH,IAAA,MAAMA,QAAA,CAAG,OAAO,IAAI,CAAA;AACpB,IAAA,OAAO,IAAA;AAAA,EACR,CAAA,CAAA,MAAQ;AACP,IAAA,OAAO,KAAA;AAAA,EACR;AACD","file":"functions.js","sourcesContent":["import { promises as fs } from \"fs\";\nimport { pathToFileURL } from \"url\";\n\nexport async function importFile<T>(filePath: string): Promise<T | null> {\n\ttry {\n\t\tconst { default: file } = await import(pathToFileURL(filePath).href);\n\t\tif (!file) return null;\n\n\t\tconst imports = file.default || file;\n\n\t\tif (typeof imports === \"function\" && imports.prototype) {\n\t\t\treturn new imports() as T;\n\t\t}\n\n\t\tif (typeof imports == \"object\") {\n\t\t\tif (Object.keys(imports).length === 0) return null;\n\t\t\treturn imports as T;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport async function exists(path: string) {\n\ttry {\n\t\tawait fs.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../src/utility/functions.ts"],"sourcesContent":["import { promises as fs } from \"fs\";\nimport { pathToFileURL } from \"url\";\n\nexport async function importFile<T>(filePath: string): Promise<T | null> {\n\ttry {\n\t\tconst { default: file } = await import(pathToFileURL(filePath).href);\n\t\tif (!file) return null;\n\n\t\tconst imports = file.default || file;\n\n\t\tif (typeof imports === \"function\" && imports.prototype) {\n\t\t\treturn new imports() as T;\n\t\t}\n\n\t\tif (typeof imports == \"object\") {\n\t\t\tif (Object.keys(imports).length === 0) return null;\n\t\t\treturn imports as T;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport async function exists(path: string) {\n\ttry {\n\t\tawait fs.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"mappings":"AAAA,SAAS,YAAY,UAAU;AAC/B,SAAS,qBAAqB;AAE9B,eAAsB,WAAc,UAAqC;AACxE,MAAI;AACH,UAAM,EAAE,SAAS,KAAK,IAAI,MAAM,OAAO,cAAc,QAAQ,EAAE;AAC/D,QAAI,CAAC,KAAM,QAAO;AAElB,UAAM,UAAU,KAAK,WAAW;AAEhC,QAAI,OAAO,YAAY,cAAc,QAAQ,WAAW;AACvD,aAAO,IAAI,QAAQ;AAAA,IACpB;AAEA,QAAI,OAAO,WAAW,UAAU;AAC/B,UAAI,OAAO,KAAK,OAAO,EAAE,WAAW,EAAG,QAAO;AAC9C,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AAEA,eAAsB,OAAO,MAAc;AAC1C,MAAI;AACH,UAAM,GAAG,OAAO,IAAI;AACpB,WAAO;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trivious",
3
- "version": "2.2.4",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "discord-bot",
@@ -44,9 +44,9 @@
44
44
  "lint": "eslint --fix src",
45
45
  "format": "prettier --write src",
46
46
  "typecheck": "tsc --noEmit",
47
- "test": "vitest run --pass-with-no-tests",
47
+ "test": "vitest",
48
+ "dev": "tsx dev/index.ts",
48
49
  "coverage": "vitest run --coverage",
49
- "dev": "tsup --watch",
50
50
  "release": "semantic-release",
51
51
  "prepare": "npm run build"
52
52
  },
@@ -56,10 +56,11 @@
56
56
  "@semantic-release/git": "^10.0.1",
57
57
  "@semantic-release/github": "^12.0.2",
58
58
  "@semantic-release/npm": "^13.1.2",
59
+ "@swc/core": "^1.15.40",
59
60
  "@types/node": "^24.10.1",
60
61
  "@typescript-eslint/eslint-plugin": "^8.57.0",
61
62
  "@typescript-eslint/parser": "^8.57.0",
62
- "@vitest/coverage-v8": "^4.0.13",
63
+ "@vitest/coverage-v8": "^4.1.7",
63
64
  "dotenv": "^17.2.3",
64
65
  "eslint": "^9.39.1",
65
66
  "eslint-config-prettier": "^10.1.8",
@@ -70,9 +71,12 @@
70
71
  "semantic-release": "^25.0.2",
71
72
  "tsc-alias": "^1.8.16",
72
73
  "tsup": "^8.5.1",
74
+ "tsx": "^4.22.3",
73
75
  "typescript": "^5.9.3",
74
76
  "typescript-eslint": "^8.57.0",
75
- "vitest": "^4.0.13"
77
+ "vite": "^8.0.14",
78
+ "vite-tsconfig-paths": "^6.1.1",
79
+ "vitest": "^4.1.7"
76
80
  },
77
81
  "dependencies": {
78
82
  "discord.js": "^14.26.4"