trivious 1.3.18 → 1.3.19

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 (89) hide show
  1. package/dist/core/client/trivious.client.cjs.map +1 -1
  2. package/dist/core/client/trivious.client.d.cts +1 -1
  3. package/dist/core/client/trivious.client.d.ts +1 -1
  4. package/dist/core/client/trivious.client.js.map +1 -1
  5. package/dist/core/commands/command.base.cjs +2 -2
  6. package/dist/core/commands/command.base.cjs.map +1 -1
  7. package/dist/core/commands/command.base.d.cts +1 -1
  8. package/dist/core/commands/command.base.d.ts +1 -1
  9. package/dist/core/commands/command.base.js +2 -2
  10. package/dist/core/commands/command.base.js.map +1 -1
  11. package/dist/core/commands/contextcommand.base.cjs +1 -1
  12. package/dist/core/commands/contextcommand.base.cjs.map +1 -1
  13. package/dist/core/commands/contextcommand.base.d.cts +1 -1
  14. package/dist/core/commands/contextcommand.base.d.ts +1 -1
  15. package/dist/core/commands/contextcommand.base.js +1 -1
  16. package/dist/core/commands/contextcommand.base.js.map +1 -1
  17. package/dist/core/commands/subcommand.base.cjs +1 -1
  18. package/dist/core/commands/subcommand.base.cjs.map +1 -1
  19. package/dist/core/commands/subcommand.base.d.cts +1 -1
  20. package/dist/core/commands/subcommand.base.d.ts +1 -1
  21. package/dist/core/commands/subcommand.base.js +1 -1
  22. package/dist/core/commands/subcommand.base.js.map +1 -1
  23. package/dist/core/components/component.base.cjs +2 -2
  24. package/dist/core/components/component.base.cjs.map +1 -1
  25. package/dist/core/components/component.base.d.cts +1 -1
  26. package/dist/core/components/component.base.d.ts +1 -1
  27. package/dist/core/components/component.base.js +2 -2
  28. package/dist/core/components/component.base.js.map +1 -1
  29. package/dist/core/events/interactionCreate.cjs +4 -4
  30. package/dist/core/events/interactionCreate.cjs.map +1 -1
  31. package/dist/core/events/interactionCreate.d.cts +1 -1
  32. package/dist/core/events/interactionCreate.d.ts +1 -1
  33. package/dist/core/events/interactionCreate.js +1 -1
  34. package/dist/core/events/interactionCreate.js.map +1 -1
  35. package/dist/core/registry/command.registry.cjs +2 -2
  36. package/dist/core/registry/command.registry.cjs.map +1 -1
  37. package/dist/core/registry/command.registry.d.cts +1 -1
  38. package/dist/core/registry/command.registry.d.ts +1 -1
  39. package/dist/core/registry/command.registry.js +2 -2
  40. package/dist/core/registry/command.registry.js.map +1 -1
  41. package/dist/core/registry/component.registry.cjs +2 -2
  42. package/dist/core/registry/component.registry.cjs.map +1 -1
  43. package/dist/core/registry/component.registry.d.cts +1 -1
  44. package/dist/core/registry/component.registry.d.ts +1 -1
  45. package/dist/core/registry/component.registry.js +2 -2
  46. package/dist/core/registry/component.registry.js.map +1 -1
  47. package/dist/core/registry/event.registry.cjs +2 -2
  48. package/dist/core/registry/event.registry.cjs.map +1 -1
  49. package/dist/core/registry/event.registry.d.cts +1 -1
  50. package/dist/core/registry/event.registry.d.ts +1 -1
  51. package/dist/core/registry/event.registry.js +2 -2
  52. package/dist/core/registry/event.registry.js.map +1 -1
  53. package/dist/core/registry/index.cjs +1 -1
  54. package/dist/core/registry/index.cjs.map +1 -1
  55. package/dist/core/registry/index.d.cts +1 -1
  56. package/dist/core/registry/index.d.ts +1 -1
  57. package/dist/core/registry/index.js +1 -1
  58. package/dist/core/registry/index.js.map +1 -1
  59. package/dist/core/registry/module.registry.cjs +2 -2
  60. package/dist/core/registry/module.registry.cjs.map +1 -1
  61. package/dist/core/registry/module.registry.d.cts +1 -1
  62. package/dist/core/registry/module.registry.d.ts +1 -1
  63. package/dist/core/registry/module.registry.js +2 -2
  64. package/dist/core/registry/module.registry.js.map +1 -1
  65. package/dist/{index-uczj1Waw.d.ts → index-BPaYmWRO.d.ts} +93 -93
  66. package/dist/{index-BCF4f686.d.cts → index-CU2Xl9Xo.d.cts} +93 -93
  67. package/dist/index.d.cts +1 -1
  68. package/dist/index.d.ts +1 -1
  69. package/dist/shared/typings/client.d.cts +1 -1
  70. package/dist/shared/typings/client.d.ts +1 -1
  71. package/dist/shared/typings/commands.d.cts +1 -1
  72. package/dist/shared/typings/commands.d.ts +1 -1
  73. package/dist/shared/typings/components.d.cts +1 -1
  74. package/dist/shared/typings/components.d.ts +1 -1
  75. package/dist/shared/typings/events.d.cts +1 -1
  76. package/dist/shared/typings/events.d.ts +1 -1
  77. package/dist/shared/typings/index.d.cts +1 -1
  78. package/dist/shared/typings/index.d.ts +1 -1
  79. package/dist/shared/typings/module.d.cts +1 -1
  80. package/dist/shared/typings/module.d.ts +1 -1
  81. package/dist/shared/typings/permissions.cjs.map +1 -1
  82. package/dist/shared/typings/permissions.d.cts +1 -1
  83. package/dist/shared/typings/permissions.d.ts +1 -1
  84. package/dist/shared/typings/permissions.js.map +1 -1
  85. package/dist/shared/utility/functions.cjs.map +1 -1
  86. package/dist/shared/utility/functions.d.cts +1 -1
  87. package/dist/shared/utility/functions.d.ts +1 -1
  88. package/dist/shared/utility/functions.js.map +1 -1
  89. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { BaseRegistry } from './shared/typings/registry.js';
2
2
  import * as discord_js from 'discord.js';
3
- import { GuildMember, AnySelectMenuInteraction, CacheType, ButtonInteraction as ButtonInteraction$1, ModalSubmitInteraction as ModalSubmitInteraction$1, SlashCommandSubcommandBuilder, ChatInputCommandInteraction as ChatInputCommandInteraction$1, MessagePayload, InteractionEditReplyOptions, InteractionReplyOptions, ContextMenuCommandBuilder, SlashCommandBuilder, Collection, ClientOptions, ClientEvents, ComponentType as ComponentType$1, Client, StringSelectMenuInteraction as StringSelectMenuInteraction$1, ContextMenuCommandInteraction as ContextMenuCommandInteraction$1 } from 'discord.js';
3
+ import { GuildMember, AnySelectMenuInteraction, CacheType, ButtonInteraction as ButtonInteraction$1, ModalSubmitInteraction as ModalSubmitInteraction$1, ContextMenuCommandBuilder, SlashCommandBuilder, MessagePayload, InteractionEditReplyOptions, InteractionReplyOptions, Collection, SlashCommandSubcommandBuilder, ChatInputCommandInteraction as ChatInputCommandInteraction$1, ClientOptions, ClientEvents, ComponentType as ComponentType$1, Client, StringSelectMenuInteraction as StringSelectMenuInteraction$1, ContextMenuCommandInteraction as ContextMenuCommandInteraction$1 } from 'discord.js';
4
4
 
5
5
  /**
6
6
  * User permission level enums
@@ -88,97 +88,6 @@ declare const deconstructCustomId: (customId: string) => {
88
88
  tags: "awaited"[];
89
89
  };
90
90
 
91
- /**
92
- * Base SubcommandBuilder.
93
- *
94
- * @export
95
- * @class SubcommandBuilder
96
- * @typedef {SubcommandBuilder}
97
- * @extends {SlashCommandSubcommandBuilder}
98
- */
99
- declare class SubcommandBuilder extends SlashCommandSubcommandBuilder {
100
- private _active;
101
- private _ownerOnly;
102
- private _permission;
103
- private _ephemeralReply;
104
- /**
105
- * Set the subcommand as disabled.
106
- *
107
- * @public
108
- * @returns {this}
109
- */
110
- disable(): this;
111
- /**
112
- * Set the subcommand as owner only.
113
- *
114
- * @public
115
- * @returns {this}
116
- */
117
- setOwnerOnly(): this;
118
- /**
119
- * Set the permission level required to run the subcommand.
120
- *
121
- * @public
122
- * @param {PermissionLevel} permission
123
- * @returns {this}
124
- */
125
- setPermission(permission: PermissionLevel): this;
126
- /**
127
- * Set the interaction as ephemeral
128
- *
129
- * @public
130
- * @returns {this}
131
- */
132
- setEphemeralReply(): this;
133
- /**
134
- * Build the builder.
135
- *
136
- * @public
137
- * @returns {{ data: SlashCommandSubcommandBuilder; metadata: SubcommandMetadata; }}
138
- */
139
- build(): {
140
- data: SlashCommandSubcommandBuilder;
141
- metadata: {
142
- active: boolean;
143
- ownerOnly: boolean;
144
- permission: PermissionLevel;
145
- ephemeralReply: boolean;
146
- };
147
- };
148
- }
149
- /**
150
- * Base Subcommand
151
- *
152
- * @export
153
- * @abstract
154
- * @class Subcommand
155
- * @typedef {Subcommand}
156
- */
157
- declare abstract class Subcommand {
158
- abstract data: SlashCommandSubcommandBuilder;
159
- abstract metadata: SubcommandMetadata;
160
- /**
161
- * Function to execute the subcommand.
162
- *
163
- * @abstract
164
- * @readonly
165
- * @type {(
166
- * client: TriviousClient,
167
- * interaction: ChatInputCommandInteraction<CacheType>
168
- * ) => Promise<void>}
169
- */
170
- abstract readonly execute: (client: TriviousClient, interaction: ChatInputCommandInteraction$1<CacheType>) => Promise<void>;
171
- /**
172
- * Reply to the interaction respecting command metadata and if the interaction has already been replied to.
173
- *
174
- * @async
175
- * @param {ChatInputCommandInteraction<CacheType>} interaction
176
- * @param {(MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions)} options
177
- * @returns {*}
178
- */
179
- reply(interaction: ChatInputCommandInteraction$1<CacheType>, options: MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions): Promise<void>;
180
- }
181
-
182
91
  /**
183
92
  * Base ContextMenuCommand.
184
93
  *
@@ -429,6 +338,97 @@ declare class CommandBuilder extends SlashCommandBuilder {
429
338
  };
430
339
  }
431
340
 
341
+ /**
342
+ * Base SubcommandBuilder.
343
+ *
344
+ * @export
345
+ * @class SubcommandBuilder
346
+ * @typedef {SubcommandBuilder}
347
+ * @extends {SlashCommandSubcommandBuilder}
348
+ */
349
+ declare class SubcommandBuilder extends SlashCommandSubcommandBuilder {
350
+ private _active;
351
+ private _ownerOnly;
352
+ private _permission;
353
+ private _ephemeralReply;
354
+ /**
355
+ * Set the subcommand as disabled.
356
+ *
357
+ * @public
358
+ * @returns {this}
359
+ */
360
+ disable(): this;
361
+ /**
362
+ * Set the subcommand as owner only.
363
+ *
364
+ * @public
365
+ * @returns {this}
366
+ */
367
+ setOwnerOnly(): this;
368
+ /**
369
+ * Set the permission level required to run the subcommand.
370
+ *
371
+ * @public
372
+ * @param {PermissionLevel} permission
373
+ * @returns {this}
374
+ */
375
+ setPermission(permission: PermissionLevel): this;
376
+ /**
377
+ * Set the interaction as ephemeral
378
+ *
379
+ * @public
380
+ * @returns {this}
381
+ */
382
+ setEphemeralReply(): this;
383
+ /**
384
+ * Build the builder.
385
+ *
386
+ * @public
387
+ * @returns {{ data: SlashCommandSubcommandBuilder; metadata: SubcommandMetadata; }}
388
+ */
389
+ build(): {
390
+ data: SlashCommandSubcommandBuilder;
391
+ metadata: {
392
+ active: boolean;
393
+ ownerOnly: boolean;
394
+ permission: PermissionLevel;
395
+ ephemeralReply: boolean;
396
+ };
397
+ };
398
+ }
399
+ /**
400
+ * Base Subcommand
401
+ *
402
+ * @export
403
+ * @abstract
404
+ * @class Subcommand
405
+ * @typedef {Subcommand}
406
+ */
407
+ declare abstract class Subcommand {
408
+ abstract data: SlashCommandSubcommandBuilder;
409
+ abstract metadata: SubcommandMetadata;
410
+ /**
411
+ * Function to execute the subcommand.
412
+ *
413
+ * @abstract
414
+ * @readonly
415
+ * @type {(
416
+ * client: TriviousClient,
417
+ * interaction: ChatInputCommandInteraction<CacheType>
418
+ * ) => Promise<void>}
419
+ */
420
+ abstract readonly execute: (client: TriviousClient, interaction: ChatInputCommandInteraction$1<CacheType>) => Promise<void>;
421
+ /**
422
+ * Reply to the interaction respecting command metadata and if the interaction has already been replied to.
423
+ *
424
+ * @async
425
+ * @param {ChatInputCommandInteraction<CacheType>} interaction
426
+ * @param {(MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions)} options
427
+ * @returns {*}
428
+ */
429
+ reply(interaction: ChatInputCommandInteraction$1<CacheType>, options: MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions): Promise<void>;
430
+ }
431
+
432
432
  /**
433
433
  * Literal type for possible CommandInteractions.
434
434
  *
@@ -924,4 +924,4 @@ type StringSelectMenuInteraction = StringSelectMenuInteraction$1<CacheType>;
924
924
  type ModalSubmitInteraction = ModalSubmitInteraction$1<CacheType>;
925
925
  type ContextMenuCommandInteraction = ContextMenuCommandInteraction$1<CacheType>;
926
926
 
927
- export { type AnyCommand as A, type ButtonInteraction as B, CommandRegistry as C, EventRegistry as E, ModuleRegistry as M, PermissionLevel as P, Subcommand as S, TriviousClient as T, ComponentRegistry as a, type TriviousClientOptions as b, type ComponentCustomIdTag as c, type ComponentInteraction as d, ComponentType as e, type ComponentMetadata as f, getPermissionLevel as g, deconstructCustomId as h, SubcommandBuilder as i, ContextMenuCommand as j, ContextMenuBuilder as k, Command as l, SlashCommand as m, CommandBuilder as n, type CommandInteraction as o, type CommandMetadata as p, type SubcommandMetadata as q, type ContextMenuMetadata as r, type Event as s, type Module as t, Component as u, ComponentBuilder as v, type ChatInputCommandInteraction as w, type StringSelectMenuInteraction as x, type ModalSubmitInteraction as y, type ContextMenuCommandInteraction as z };
927
+ export { type AnyCommand as A, type ButtonInteraction as B, CommandRegistry as C, EventRegistry as E, ModuleRegistry as M, PermissionLevel as P, SlashCommand as S, TriviousClient as T, ComponentRegistry as a, type TriviousClientOptions as b, type ComponentCustomIdTag as c, type ComponentInteraction as d, ComponentType as e, type ComponentMetadata as f, getPermissionLevel as g, deconstructCustomId as h, ContextMenuCommand as i, ContextMenuBuilder as j, Command as k, CommandBuilder as l, Subcommand as m, SubcommandBuilder as n, type CommandInteraction as o, type CommandMetadata as p, type SubcommandMetadata as q, type ContextMenuMetadata as r, type Event as s, type Module as t, Component as u, ComponentBuilder as v, type ChatInputCommandInteraction as w, type StringSelectMenuInteraction as x, type ModalSubmitInteraction as y, type ContextMenuCommandInteraction as z };
@@ -1,6 +1,6 @@
1
1
  import { BaseRegistry } from './shared/typings/registry.cjs';
2
2
  import * as discord_js from 'discord.js';
3
- import { GuildMember, AnySelectMenuInteraction, CacheType, ButtonInteraction as ButtonInteraction$1, ModalSubmitInteraction as ModalSubmitInteraction$1, SlashCommandSubcommandBuilder, ChatInputCommandInteraction as ChatInputCommandInteraction$1, MessagePayload, InteractionEditReplyOptions, InteractionReplyOptions, ContextMenuCommandBuilder, SlashCommandBuilder, Collection, ClientOptions, ClientEvents, ComponentType as ComponentType$1, Client, StringSelectMenuInteraction as StringSelectMenuInteraction$1, ContextMenuCommandInteraction as ContextMenuCommandInteraction$1 } from 'discord.js';
3
+ import { GuildMember, AnySelectMenuInteraction, CacheType, ButtonInteraction as ButtonInteraction$1, ModalSubmitInteraction as ModalSubmitInteraction$1, ContextMenuCommandBuilder, SlashCommandBuilder, MessagePayload, InteractionEditReplyOptions, InteractionReplyOptions, Collection, SlashCommandSubcommandBuilder, ChatInputCommandInteraction as ChatInputCommandInteraction$1, ClientOptions, ClientEvents, ComponentType as ComponentType$1, Client, StringSelectMenuInteraction as StringSelectMenuInteraction$1, ContextMenuCommandInteraction as ContextMenuCommandInteraction$1 } from 'discord.js';
4
4
 
5
5
  /**
6
6
  * User permission level enums
@@ -88,97 +88,6 @@ declare const deconstructCustomId: (customId: string) => {
88
88
  tags: "awaited"[];
89
89
  };
90
90
 
91
- /**
92
- * Base SubcommandBuilder.
93
- *
94
- * @export
95
- * @class SubcommandBuilder
96
- * @typedef {SubcommandBuilder}
97
- * @extends {SlashCommandSubcommandBuilder}
98
- */
99
- declare class SubcommandBuilder extends SlashCommandSubcommandBuilder {
100
- private _active;
101
- private _ownerOnly;
102
- private _permission;
103
- private _ephemeralReply;
104
- /**
105
- * Set the subcommand as disabled.
106
- *
107
- * @public
108
- * @returns {this}
109
- */
110
- disable(): this;
111
- /**
112
- * Set the subcommand as owner only.
113
- *
114
- * @public
115
- * @returns {this}
116
- */
117
- setOwnerOnly(): this;
118
- /**
119
- * Set the permission level required to run the subcommand.
120
- *
121
- * @public
122
- * @param {PermissionLevel} permission
123
- * @returns {this}
124
- */
125
- setPermission(permission: PermissionLevel): this;
126
- /**
127
- * Set the interaction as ephemeral
128
- *
129
- * @public
130
- * @returns {this}
131
- */
132
- setEphemeralReply(): this;
133
- /**
134
- * Build the builder.
135
- *
136
- * @public
137
- * @returns {{ data: SlashCommandSubcommandBuilder; metadata: SubcommandMetadata; }}
138
- */
139
- build(): {
140
- data: SlashCommandSubcommandBuilder;
141
- metadata: {
142
- active: boolean;
143
- ownerOnly: boolean;
144
- permission: PermissionLevel;
145
- ephemeralReply: boolean;
146
- };
147
- };
148
- }
149
- /**
150
- * Base Subcommand
151
- *
152
- * @export
153
- * @abstract
154
- * @class Subcommand
155
- * @typedef {Subcommand}
156
- */
157
- declare abstract class Subcommand {
158
- abstract data: SlashCommandSubcommandBuilder;
159
- abstract metadata: SubcommandMetadata;
160
- /**
161
- * Function to execute the subcommand.
162
- *
163
- * @abstract
164
- * @readonly
165
- * @type {(
166
- * client: TriviousClient,
167
- * interaction: ChatInputCommandInteraction<CacheType>
168
- * ) => Promise<void>}
169
- */
170
- abstract readonly execute: (client: TriviousClient, interaction: ChatInputCommandInteraction$1<CacheType>) => Promise<void>;
171
- /**
172
- * Reply to the interaction respecting command metadata and if the interaction has already been replied to.
173
- *
174
- * @async
175
- * @param {ChatInputCommandInteraction<CacheType>} interaction
176
- * @param {(MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions)} options
177
- * @returns {*}
178
- */
179
- reply(interaction: ChatInputCommandInteraction$1<CacheType>, options: MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions): Promise<void>;
180
- }
181
-
182
91
  /**
183
92
  * Base ContextMenuCommand.
184
93
  *
@@ -429,6 +338,97 @@ declare class CommandBuilder extends SlashCommandBuilder {
429
338
  };
430
339
  }
431
340
 
341
+ /**
342
+ * Base SubcommandBuilder.
343
+ *
344
+ * @export
345
+ * @class SubcommandBuilder
346
+ * @typedef {SubcommandBuilder}
347
+ * @extends {SlashCommandSubcommandBuilder}
348
+ */
349
+ declare class SubcommandBuilder extends SlashCommandSubcommandBuilder {
350
+ private _active;
351
+ private _ownerOnly;
352
+ private _permission;
353
+ private _ephemeralReply;
354
+ /**
355
+ * Set the subcommand as disabled.
356
+ *
357
+ * @public
358
+ * @returns {this}
359
+ */
360
+ disable(): this;
361
+ /**
362
+ * Set the subcommand as owner only.
363
+ *
364
+ * @public
365
+ * @returns {this}
366
+ */
367
+ setOwnerOnly(): this;
368
+ /**
369
+ * Set the permission level required to run the subcommand.
370
+ *
371
+ * @public
372
+ * @param {PermissionLevel} permission
373
+ * @returns {this}
374
+ */
375
+ setPermission(permission: PermissionLevel): this;
376
+ /**
377
+ * Set the interaction as ephemeral
378
+ *
379
+ * @public
380
+ * @returns {this}
381
+ */
382
+ setEphemeralReply(): this;
383
+ /**
384
+ * Build the builder.
385
+ *
386
+ * @public
387
+ * @returns {{ data: SlashCommandSubcommandBuilder; metadata: SubcommandMetadata; }}
388
+ */
389
+ build(): {
390
+ data: SlashCommandSubcommandBuilder;
391
+ metadata: {
392
+ active: boolean;
393
+ ownerOnly: boolean;
394
+ permission: PermissionLevel;
395
+ ephemeralReply: boolean;
396
+ };
397
+ };
398
+ }
399
+ /**
400
+ * Base Subcommand
401
+ *
402
+ * @export
403
+ * @abstract
404
+ * @class Subcommand
405
+ * @typedef {Subcommand}
406
+ */
407
+ declare abstract class Subcommand {
408
+ abstract data: SlashCommandSubcommandBuilder;
409
+ abstract metadata: SubcommandMetadata;
410
+ /**
411
+ * Function to execute the subcommand.
412
+ *
413
+ * @abstract
414
+ * @readonly
415
+ * @type {(
416
+ * client: TriviousClient,
417
+ * interaction: ChatInputCommandInteraction<CacheType>
418
+ * ) => Promise<void>}
419
+ */
420
+ abstract readonly execute: (client: TriviousClient, interaction: ChatInputCommandInteraction$1<CacheType>) => Promise<void>;
421
+ /**
422
+ * Reply to the interaction respecting command metadata and if the interaction has already been replied to.
423
+ *
424
+ * @async
425
+ * @param {ChatInputCommandInteraction<CacheType>} interaction
426
+ * @param {(MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions)} options
427
+ * @returns {*}
428
+ */
429
+ reply(interaction: ChatInputCommandInteraction$1<CacheType>, options: MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions): Promise<void>;
430
+ }
431
+
432
432
  /**
433
433
  * Literal type for possible CommandInteractions.
434
434
  *
@@ -924,4 +924,4 @@ type StringSelectMenuInteraction = StringSelectMenuInteraction$1<CacheType>;
924
924
  type ModalSubmitInteraction = ModalSubmitInteraction$1<CacheType>;
925
925
  type ContextMenuCommandInteraction = ContextMenuCommandInteraction$1<CacheType>;
926
926
 
927
- export { type AnyCommand as A, type ButtonInteraction as B, CommandRegistry as C, EventRegistry as E, ModuleRegistry as M, PermissionLevel as P, Subcommand as S, TriviousClient as T, ComponentRegistry as a, type TriviousClientOptions as b, type ComponentCustomIdTag as c, type ComponentInteraction as d, ComponentType as e, type ComponentMetadata as f, getPermissionLevel as g, deconstructCustomId as h, SubcommandBuilder as i, ContextMenuCommand as j, ContextMenuBuilder as k, Command as l, SlashCommand as m, CommandBuilder as n, type CommandInteraction as o, type CommandMetadata as p, type SubcommandMetadata as q, type ContextMenuMetadata as r, type Event as s, type Module as t, Component as u, ComponentBuilder as v, type ChatInputCommandInteraction as w, type StringSelectMenuInteraction as x, type ModalSubmitInteraction as y, type ContextMenuCommandInteraction as z };
927
+ export { type AnyCommand as A, type ButtonInteraction as B, CommandRegistry as C, EventRegistry as E, ModuleRegistry as M, PermissionLevel as P, SlashCommand as S, TriviousClient as T, ComponentRegistry as a, type TriviousClientOptions as b, type ComponentCustomIdTag as c, type ComponentInteraction as d, ComponentType as e, type ComponentMetadata as f, getPermissionLevel as g, deconstructCustomId as h, ContextMenuCommand as i, ContextMenuBuilder as j, Command as k, CommandBuilder as l, Subcommand as m, SubcommandBuilder as n, type CommandInteraction as o, type CommandMetadata as p, type SubcommandMetadata as q, type ContextMenuMetadata as r, type Event as s, type Module as t, Component as u, ComponentBuilder as v, type ChatInputCommandInteraction as w, type StringSelectMenuInteraction as x, type ModalSubmitInteraction as y, type ContextMenuCommandInteraction as z };
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { ClientEvents, Collection } from 'discord.js';
2
- export { A as AnyCommand, B as ButtonInteraction, w as ChatInputCommandInteraction, l as Command, n as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, u as Component, v as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, k as ContextMenuBuilder, j as ContextMenuCommand, z as ContextMenuCommandInteraction, r as ContextMenuMetadata, s as Event, y as ModalSubmitInteraction, t as Module, P as PermissionLevel, m as SlashCommand, x as StringSelectMenuInteraction, S as Subcommand, i as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-BCF4f686.cjs';
2
+ export { A as AnyCommand, B as ButtonInteraction, w as ChatInputCommandInteraction, k as Command, l as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, u as Component, v as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, j as ContextMenuBuilder, i as ContextMenuCommand, z as ContextMenuCommandInteraction, r as ContextMenuMetadata, s as Event, y as ModalSubmitInteraction, t as Module, P as PermissionLevel, S as SlashCommand, x as StringSelectMenuInteraction, m as Subcommand, n as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-CU2Xl9Xo.cjs';
3
3
  export { BaseRegistry } from './shared/typings/registry.cjs';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { ClientEvents, Collection } from 'discord.js';
2
- export { A as AnyCommand, B as ButtonInteraction, w as ChatInputCommandInteraction, l as Command, n as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, u as Component, v as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, k as ContextMenuBuilder, j as ContextMenuCommand, z as ContextMenuCommandInteraction, r as ContextMenuMetadata, s as Event, y as ModalSubmitInteraction, t as Module, P as PermissionLevel, m as SlashCommand, x as StringSelectMenuInteraction, S as Subcommand, i as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-uczj1Waw.js';
2
+ export { A as AnyCommand, B as ButtonInteraction, w as ChatInputCommandInteraction, k as Command, l as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, u as Component, v as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, j as ContextMenuBuilder, i as ContextMenuCommand, z as ContextMenuCommandInteraction, r as ContextMenuMetadata, s as Event, y as ModalSubmitInteraction, t as Module, P as PermissionLevel, S as SlashCommand, x as StringSelectMenuInteraction, m as Subcommand, n as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-BPaYmWRO.js';
3
3
  export { BaseRegistry } from './shared/typings/registry.js';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { b as TriviousClientOptions } from '../../index-BCF4f686.cjs';
2
+ export { b as TriviousClientOptions } from '../../index-CU2Xl9Xo.cjs';
3
3
  import './registry.cjs';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { b as TriviousClientOptions } from '../../index-uczj1Waw.js';
2
+ export { b as TriviousClientOptions } from '../../index-BPaYmWRO.js';
3
3
  import './registry.js';
@@ -1,3 +1,3 @@
1
+ export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-CU2Xl9Xo.cjs';
1
2
  import 'discord.js';
2
- export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-BCF4f686.cjs';
3
3
  import './registry.cjs';
@@ -1,3 +1,3 @@
1
+ export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-BPaYmWRO.js';
1
2
  import 'discord.js';
2
- export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-uczj1Waw.js';
3
3
  import './registry.js';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-BCF4f686.cjs';
2
+ export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-CU2Xl9Xo.cjs';
3
3
  import './registry.cjs';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-uczj1Waw.js';
2
+ export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-BPaYmWRO.js';
3
3
  import './registry.js';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { s as Event } from '../../index-BCF4f686.cjs';
2
+ export { s as Event } from '../../index-CU2Xl9Xo.cjs';
3
3
  import './registry.cjs';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { s as Event } from '../../index-uczj1Waw.js';
2
+ export { s as Event } from '../../index-BPaYmWRO.js';
3
3
  import './registry.js';
@@ -1,3 +1,3 @@
1
- export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, s as Event, t as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-BCF4f686.cjs';
1
+ export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, s as Event, t as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-CU2Xl9Xo.cjs';
2
2
  export { BaseRegistry } from './registry.cjs';
3
3
  import 'discord.js';
@@ -1,3 +1,3 @@
1
- export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, s as Event, t as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-uczj1Waw.js';
1
+ export { A as AnyCommand, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, s as Event, t as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-BPaYmWRO.js';
2
2
  export { BaseRegistry } from './registry.js';
3
3
  import 'discord.js';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { t as Module } from '../../index-BCF4f686.cjs';
2
+ export { t as Module } from '../../index-CU2Xl9Xo.cjs';
3
3
  import './registry.cjs';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { t as Module } from '../../index-uczj1Waw.js';
2
+ export { t as Module } from '../../index-BPaYmWRO.js';
3
3
  import './registry.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/typings/permissions.ts"],"names":["PermissionLevel"],"mappings":";;AASO,IAAK,eAAA,qBAAAA,gBAAAA,KAAL;AACN,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,UAAO,CAAA,CAAA,GAAP,MAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,qBAAkB,CAAA,CAAA,GAAlB,iBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,yBAAsB,CAAA,CAAA,GAAtB,qBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,eAAY,CAAA,CAAA,GAAZ,WAAA;AANW,EAAA,OAAAA,gBAAAA;AAAA,CAAA,EAAA,eAAA,IAAA,EAAA;AAeL,MAAM,kBAAA,GAAqB,CAAC,MAAA,EAAwB,MAAA,KAAwB;AAClF,EAAA,MAAM,WAAA,GAAc,OAAO,KAAA,CAAM,OAAA;AACjC,EAAA,IAAI,OAAO,IAAA,CAAK,EAAA,KAAO,MAAA,CAAO,KAAA,CAAM,SAAS,OAAO,CAAA;AAEpD,EAAA,MAAM,kBAAkB,MAAA,CAAO,eAAA;AAC/B,EAAA,OAAO,eAAA,CAAgB,WAAA,CAAY,IAAI,CAAA,IAAK,CAAA;AAC7C","file":"permissions.cjs","sourcesContent":["import { GuildMember } from \"discord.js\";\nimport TriviousClient from \"src/core/client/trivious.client.js\";\n\n/**\n * User permission level enums\n *\n * @export\n * @enum {number}\n */\nexport enum PermissionLevel {\n\tUSER = 0,\n\tGUILD_STAFF = 1,\n\tGUILD_MODERATOR = 2,\n\tGUILD_ADMINISTRATOR = 3,\n\tGUILD_OWNER = 4,\n\tBOT_OWNER = 5,\n}\n\n/**\n * Get the permission level of a user.\n *\n * @param {GuildMember} member\n * @returns {*}\n */\nexport const getPermissionLevel = (client: TriviousClient, member: GuildMember) => {\n\tconst highestRole = member.roles.highest;\n\tif (member.user.id === member.guild.ownerId) return PermissionLevel.GUILD_OWNER;\n\n\tconst rolePermissions = client.rolePermissions;\n\treturn rolePermissions[highestRole.name] ?? PermissionLevel.USER;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/shared/typings/permissions.ts"],"names":["PermissionLevel"],"mappings":";;AASO,IAAK,eAAA,qBAAAA,gBAAAA,KAAL;AACN,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,UAAO,CAAA,CAAA,GAAP,MAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,qBAAkB,CAAA,CAAA,GAAlB,iBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,yBAAsB,CAAA,CAAA,GAAtB,qBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,eAAY,CAAA,CAAA,GAAZ,WAAA;AANW,EAAA,OAAAA,gBAAAA;AAAA,CAAA,EAAA,eAAA,IAAA,EAAA;AAeL,MAAM,kBAAA,GAAqB,CAAC,MAAA,EAAwB,MAAA,KAAwB;AAClF,EAAA,MAAM,WAAA,GAAc,OAAO,KAAA,CAAM,OAAA;AACjC,EAAA,IAAI,OAAO,IAAA,CAAK,EAAA,KAAO,MAAA,CAAO,KAAA,CAAM,SAAS,OAAO,CAAA;AAEpD,EAAA,MAAM,kBAAkB,MAAA,CAAO,eAAA;AAC/B,EAAA,OAAO,eAAA,CAAgB,WAAA,CAAY,IAAI,CAAA,IAAK,CAAA;AAC7C","file":"permissions.cjs","sourcesContent":["import { GuildMember } from \"discord.js\";\nimport TriviousClient from \"../../core/client/trivious.client.js\";\n\n/**\n * User permission level enums\n *\n * @export\n * @enum {number}\n */\nexport enum PermissionLevel {\n\tUSER = 0,\n\tGUILD_STAFF = 1,\n\tGUILD_MODERATOR = 2,\n\tGUILD_ADMINISTRATOR = 3,\n\tGUILD_OWNER = 4,\n\tBOT_OWNER = 5,\n}\n\n/**\n * Get the permission level of a user.\n *\n * @param {GuildMember} member\n * @returns {*}\n */\nexport const getPermissionLevel = (client: TriviousClient, member: GuildMember) => {\n\tconst highestRole = member.roles.highest;\n\tif (member.user.id === member.guild.ownerId) return PermissionLevel.GUILD_OWNER;\n\n\tconst rolePermissions = client.rolePermissions;\n\treturn rolePermissions[highestRole.name] ?? PermissionLevel.USER;\n};\n"]}
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { P as PermissionLevel, g as getPermissionLevel } from '../../index-BCF4f686.cjs';
2
+ export { P as PermissionLevel, g as getPermissionLevel } from '../../index-CU2Xl9Xo.cjs';
3
3
  import './registry.cjs';
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { P as PermissionLevel, g as getPermissionLevel } from '../../index-uczj1Waw.js';
2
+ export { P as PermissionLevel, g as getPermissionLevel } from '../../index-BPaYmWRO.js';
3
3
  import './registry.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/typings/permissions.ts"],"names":["PermissionLevel"],"mappings":"AASO,IAAK,eAAA,qBAAAA,gBAAAA,KAAL;AACN,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,UAAO,CAAA,CAAA,GAAP,MAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,qBAAkB,CAAA,CAAA,GAAlB,iBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,yBAAsB,CAAA,CAAA,GAAtB,qBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,eAAY,CAAA,CAAA,GAAZ,WAAA;AANW,EAAA,OAAAA,gBAAAA;AAAA,CAAA,EAAA,eAAA,IAAA,EAAA;AAeL,MAAM,kBAAA,GAAqB,CAAC,MAAA,EAAwB,MAAA,KAAwB;AAClF,EAAA,MAAM,WAAA,GAAc,OAAO,KAAA,CAAM,OAAA;AACjC,EAAA,IAAI,OAAO,IAAA,CAAK,EAAA,KAAO,MAAA,CAAO,KAAA,CAAM,SAAS,OAAO,CAAA;AAEpD,EAAA,MAAM,kBAAkB,MAAA,CAAO,eAAA;AAC/B,EAAA,OAAO,eAAA,CAAgB,WAAA,CAAY,IAAI,CAAA,IAAK,CAAA;AAC7C","file":"permissions.js","sourcesContent":["import { GuildMember } from \"discord.js\";\nimport TriviousClient from \"src/core/client/trivious.client.js\";\n\n/**\n * User permission level enums\n *\n * @export\n * @enum {number}\n */\nexport enum PermissionLevel {\n\tUSER = 0,\n\tGUILD_STAFF = 1,\n\tGUILD_MODERATOR = 2,\n\tGUILD_ADMINISTRATOR = 3,\n\tGUILD_OWNER = 4,\n\tBOT_OWNER = 5,\n}\n\n/**\n * Get the permission level of a user.\n *\n * @param {GuildMember} member\n * @returns {*}\n */\nexport const getPermissionLevel = (client: TriviousClient, member: GuildMember) => {\n\tconst highestRole = member.roles.highest;\n\tif (member.user.id === member.guild.ownerId) return PermissionLevel.GUILD_OWNER;\n\n\tconst rolePermissions = client.rolePermissions;\n\treturn rolePermissions[highestRole.name] ?? PermissionLevel.USER;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/shared/typings/permissions.ts"],"names":["PermissionLevel"],"mappings":"AASO,IAAK,eAAA,qBAAAA,gBAAAA,KAAL;AACN,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,UAAO,CAAA,CAAA,GAAP,MAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,qBAAkB,CAAA,CAAA,GAAlB,iBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,yBAAsB,CAAA,CAAA,GAAtB,qBAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,gBAAAA,CAAAA,gBAAAA,CAAA,eAAY,CAAA,CAAA,GAAZ,WAAA;AANW,EAAA,OAAAA,gBAAAA;AAAA,CAAA,EAAA,eAAA,IAAA,EAAA;AAeL,MAAM,kBAAA,GAAqB,CAAC,MAAA,EAAwB,MAAA,KAAwB;AAClF,EAAA,MAAM,WAAA,GAAc,OAAO,KAAA,CAAM,OAAA;AACjC,EAAA,IAAI,OAAO,IAAA,CAAK,EAAA,KAAO,MAAA,CAAO,KAAA,CAAM,SAAS,OAAO,CAAA;AAEpD,EAAA,MAAM,kBAAkB,MAAA,CAAO,eAAA;AAC/B,EAAA,OAAO,eAAA,CAAgB,WAAA,CAAY,IAAI,CAAA,IAAK,CAAA;AAC7C","file":"permissions.js","sourcesContent":["import { GuildMember } from \"discord.js\";\nimport TriviousClient from \"../../core/client/trivious.client.js\";\n\n/**\n * User permission level enums\n *\n * @export\n * @enum {number}\n */\nexport enum PermissionLevel {\n\tUSER = 0,\n\tGUILD_STAFF = 1,\n\tGUILD_MODERATOR = 2,\n\tGUILD_ADMINISTRATOR = 3,\n\tGUILD_OWNER = 4,\n\tBOT_OWNER = 5,\n}\n\n/**\n * Get the permission level of a user.\n *\n * @param {GuildMember} member\n * @returns {*}\n */\nexport const getPermissionLevel = (client: TriviousClient, member: GuildMember) => {\n\tconst highestRole = member.roles.highest;\n\tif (member.user.id === member.guild.ownerId) return PermissionLevel.GUILD_OWNER;\n\n\tconst rolePermissions = client.rolePermissions;\n\treturn rolePermissions[highestRole.name] ?? PermissionLevel.USER;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/utility/functions.ts"],"names":["__filename","fileURLToPath","__dirname","dirname","existsSync","join","resolve","fs","PermissionLevel","getPermissionLevel"],"mappings":";;;;;;;;;AAQA,MAAMA,YAAA,GAAaC,iBAAA,CAAc,+PAAe,CAAA;AAChD,MAAMC,WAAA,GAAYC,aAAQH,YAAU,CAAA;AAOpC,MAAM,iBAAiB,MAAc;AACpC,EAAA,IAAI,GAAA,GAAME,WAAA;AAEV,EAAA,OAAO,GAAA,KAAQC,YAAA,CAAQ,GAAG,CAAA,EAAG;AAC5B,IAAA,IAAIC,aAAA,CAAWC,cAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,IAAKD,aAAA,CAAWC,cAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,EAAG;AACnF,MAAA,OAAO,GAAA;AAAA,IACR;AACA,IAAA,GAAA,GAAMF,aAAQ,GAAG,CAAA;AAAA,EAClB;AACA,EAAA,OAAOD,WAAA;AACR,CAAA;AAOO,MAAM,yBAAyB,cAAA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AAQ,GAAA,EAAI,EAAG,YAAY,CAAA;AACxC;AAUA,eAAsB,OAAO,IAAA,EAAc;AAC1C,EAAA,IAAI;AACH,IAAA,MAAME,WAAA,CAAG,OAAO,IAAI,CAAA;AACpB,IAAA,OAAO,IAAA;AAAA,EACR,CAAA,CAAA,MAAQ;AACP,IAAA,OAAO,KAAA;AAAA,EACR;AACD;AAaO,SAAS,aAAA,CACf,QACA,OAAA,EAKC;AACD,EAAA,MAAM,EAAE,UAAA,EAAY,IAAA,EAAM,MAAA,EAAO,GAAI,OAAA;AAErC,EAAA,IAAI,IAAA,EAAM;AACT,IAAA,IAAI,UAAA,KAAeC,8BAAA,CAAgB,SAAA,EAAW,OAAO,KAAK,EAAA,KAAO,oBAAA;AACjE,IAAA,OAAO,IAAA;AAAA,EACR;AAEA,EAAA,IAAI,MAAA,EAAQ;AACX,IAAA,MAAM,gBAAA,GAAmBC,iCAAA,CAAmB,MAAA,EAAQ,MAAM,CAAA;AAC1D,IAAA,OAAO,gBAAA,IAAoB,UAAA;AAAA,EAC5B;AAEA,EAAA,OAAO,KAAA;AACR","file":"functions.cjs","sourcesContent":["import { promises as fs, existsSync } from \"fs\";\nimport { join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"url\";\nimport { dirname } from \"path\";\nimport { getPermissionLevel, PermissionLevel } from \"../typings/permissions.js\";\nimport { GuildMember, User } from \"discord.js\";\nimport TriviousClient from \"src/core/client/trivious.client.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Get the package root.\n *\n * @returns {string}\n */\nconst getPackageRoot = (): string => {\n\tlet dir = __dirname;\n\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \"node_modules\"))) {\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn __dirname;\n};\n\n/**\n * Framework package root.\n *\n * @type {string}\n */\nexport const FRAMEWORK_PACKAGE_ROOT = getPackageRoot();\n\n/**\n * Get the core path.\n *\n * @export\n * @param {{ userPath?: string; coreDirectory: string }} options\n * @returns {string}\n */\nexport function getCorePath(options: { userPath?: string; coreDirectory: string }): string {\n\tconst { userPath, coreDirectory } = options;\n\tif (userPath) {\n\t\treturn resolveUserPath(userPath);\n\t}\n\n\tconst builtInCandidates = [\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", coreDirectory),\n\t];\n\n\tfor (const candidate of builtInCandidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\treturn join(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory);\n}\n\n/**\n * Resolve a user given core path.\n *\n * @export\n * @param {string} relativePath\n * @returns {string}\n */\nexport function resolveUserPath(relativePath: string): string {\n\tconst candidates = [\n\t\tjoin(process.cwd(), relativePath),\n\n\t\tjoin(process.cwd(), \"lib\", relativePath),\n\t\tjoin(process.cwd(), \"dist\", relativePath),\n\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", relativePath),\n\t];\n\n\tfor (const candidate of candidates) {\n\t\tconst full = resolve(candidate);\n\t\tif (existsSync(full)) return full;\n\t}\n\n\treturn join(process.cwd(), relativePath);\n}\n\n/**\n * Whether a directory or file exists.\n *\n * @export\n * @async\n * @param {string} path\n * @returns {unknown}\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\n/**\n * Whether a user/member has permission.\n *\n * @export\n * @param {{\n * \tpermission: PermissionLevel;\n * \tuser?: User;\n * \tmember?: GuildMember;\n * }} options\n * @returns {boolean}\n */\nexport function hasPermission(\n\tclient: TriviousClient,\n\toptions: {\n\t\tpermission: PermissionLevel;\n\t\tuser?: User;\n\t\tmember?: GuildMember;\n\t}\n) {\n\tconst { permission, user, member } = options;\n\n\tif (user) {\n\t\tif (permission === PermissionLevel.BOT_OWNER) return user.id === \"424764032667484171\";\n\t\treturn true;\n\t}\n\n\tif (member) {\n\t\tconst memberPermission = getPermissionLevel(client, member);\n\t\treturn memberPermission >= permission;\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/shared/utility/functions.ts"],"names":["__filename","fileURLToPath","__dirname","dirname","existsSync","join","resolve","fs","PermissionLevel","getPermissionLevel"],"mappings":";;;;;;;;;AAQA,MAAMA,YAAA,GAAaC,iBAAA,CAAc,+PAAe,CAAA;AAChD,MAAMC,WAAA,GAAYC,aAAQH,YAAU,CAAA;AAOpC,MAAM,iBAAiB,MAAc;AACpC,EAAA,IAAI,GAAA,GAAME,WAAA;AAEV,EAAA,OAAO,GAAA,KAAQC,YAAA,CAAQ,GAAG,CAAA,EAAG;AAC5B,IAAA,IAAIC,aAAA,CAAWC,cAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,IAAKD,aAAA,CAAWC,cAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,EAAG;AACnF,MAAA,OAAO,GAAA;AAAA,IACR;AACA,IAAA,GAAA,GAAMF,aAAQ,GAAG,CAAA;AAAA,EAClB;AACA,EAAA,OAAOD,WAAA;AACR,CAAA;AAOO,MAAM,yBAAyB,cAAA;AAS/B,SAAS,YAAY,OAAA,EAA+D;AAC1F,EAAA,MAAM,EAAE,QAAA,EAAU,aAAA,EAAc,GAAI,OAAA;AACpC,EAAA,IAAI,QAAA,EAAU;AACb,IAAA,OAAO,gBAAgB,QAAQ,CAAA;AAAA,EAChC;AAEA,EAAA,MAAM,iBAAA,GAAoB;AAAA,IACzBG,cAAA,CAAK,sBAAA,EAAwB,KAAA,EAAO,aAAa,CAAA;AAAA,IACjDA,cAAA,CAAK,sBAAA,EAAwB,MAAA,EAAQ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,EAAO,GAAI,OAAA;AAErC,EAAA,IAAI,IAAA,EAAM;AACT,IAAA,IAAI,UAAA,KAAeC,8BAAA,CAAgB,SAAA,EAAW,OAAO,KAAK,EAAA,KAAO,oBAAA;AACjE,IAAA,OAAO,IAAA;AAAA,EACR;AAEA,EAAA,IAAI,MAAA,EAAQ;AACX,IAAA,MAAM,gBAAA,GAAmBC,iCAAA,CAAmB,MAAA,EAAQ,MAAM,CAAA;AAC1D,IAAA,OAAO,gBAAA,IAAoB,UAAA;AAAA,EAC5B;AAEA,EAAA,OAAO,KAAA;AACR","file":"functions.cjs","sourcesContent":["import TriviousClient from \"../../core/client/trivious.client.js\";\nimport { promises as fs, existsSync } from \"fs\";\nimport { join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"url\";\nimport { dirname } from \"path\";\nimport { getPermissionLevel, PermissionLevel } from \"../typings/permissions.js\";\nimport { GuildMember, User } from \"discord.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Get the package root.\n *\n * @returns {string}\n */\nconst getPackageRoot = (): string => {\n\tlet dir = __dirname;\n\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \"node_modules\"))) {\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn __dirname;\n};\n\n/**\n * Framework package root.\n *\n * @type {string}\n */\nexport const FRAMEWORK_PACKAGE_ROOT = getPackageRoot();\n\n/**\n * Get the core path.\n *\n * @export\n * @param {{ userPath?: string; coreDirectory: string }} options\n * @returns {string}\n */\nexport function getCorePath(options: { userPath?: string; coreDirectory: string }): string {\n\tconst { userPath, coreDirectory } = options;\n\tif (userPath) {\n\t\treturn resolveUserPath(userPath);\n\t}\n\n\tconst builtInCandidates = [\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", coreDirectory),\n\t];\n\n\tfor (const candidate of builtInCandidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\treturn join(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory);\n}\n\n/**\n * Resolve a user given core path.\n *\n * @export\n * @param {string} relativePath\n * @returns {string}\n */\nexport function resolveUserPath(relativePath: string): string {\n\tconst candidates = [\n\t\tjoin(process.cwd(), relativePath),\n\n\t\tjoin(process.cwd(), \"lib\", relativePath),\n\t\tjoin(process.cwd(), \"dist\", relativePath),\n\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", relativePath),\n\t];\n\n\tfor (const candidate of candidates) {\n\t\tconst full = resolve(candidate);\n\t\tif (existsSync(full)) return full;\n\t}\n\n\treturn join(process.cwd(), relativePath);\n}\n\n/**\n * Whether a directory or file exists.\n *\n * @export\n * @async\n * @param {string} path\n * @returns {unknown}\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\n/**\n * Whether a user/member has permission.\n *\n * @export\n * @param {{\n * \tpermission: PermissionLevel;\n * \tuser?: User;\n * \tmember?: GuildMember;\n * }} options\n * @returns {boolean}\n */\nexport function hasPermission(\n\tclient: TriviousClient,\n\toptions: {\n\t\tpermission: PermissionLevel;\n\t\tuser?: User;\n\t\tmember?: GuildMember;\n\t}\n) {\n\tconst { permission, user, member } = options;\n\n\tif (user) {\n\t\tif (permission === PermissionLevel.BOT_OWNER) return user.id === \"424764032667484171\";\n\t\treturn true;\n\t}\n\n\tif (member) {\n\t\tconst memberPermission = getPermissionLevel(client, member);\n\t\treturn memberPermission >= permission;\n\t}\n\n\treturn false;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient, P as PermissionLevel } from '../../index-BCF4f686.cjs';
1
+ import { T as TriviousClient, P as PermissionLevel } from '../../index-CU2Xl9Xo.cjs';
2
2
  import { User, GuildMember } from 'discord.js';
3
3
  import '../typings/registry.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient, P as PermissionLevel } from '../../index-uczj1Waw.js';
1
+ import { T as TriviousClient, P as PermissionLevel } from '../../index-BPaYmWRO.js';
2
2
  import { User, GuildMember } from 'discord.js';
3
3
  import '../typings/registry.js';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/utility/functions.ts"],"names":["__filename","__dirname","fs"],"mappings":";;;;;;AAQA,MAAMA,YAAA,GAAa,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AAChD,MAAMC,WAAA,GAAY,QAAQD,YAAU,CAAA;AAOpC,MAAM,iBAAiB,MAAc;AACpC,EAAA,IAAI,GAAA,GAAMC,WAAA;AAEV,EAAA,OAAO,GAAA,KAAQ,OAAA,CAAQ,GAAG,CAAA,EAAG;AAC5B,IAAA,IAAI,UAAA,CAAW,IAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,IAAK,UAAA,CAAW,IAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,EAAG;AACnF,MAAA,OAAO,GAAA;AAAA,IACR;AACA,IAAA,GAAA,GAAM,QAAQ,GAAG,CAAA;AAAA,EAClB;AACA,EAAA,OAAOA,WAAA;AACR,CAAA;AAOO,MAAM,yBAAyB,cAAA;AAS/B,SAAS,YAAY,OAAA,EAA+D;AAC1F,EAAA,MAAM,EAAE,QAAA,EAAU,aAAA,EAAc,GAAI,OAAA;AACpC,EAAA,IAAI,QAAA,EAAU;AACb,IAAA,OAAO,gBAAgB,QAAQ,CAAA;AAAA,EAChC;AAEA,EAAA,MAAM,iBAAA,GAAoB;AAAA,IACzB,IAAA,CAAK,sBAAA,EAAwB,KAAA,EAAO,aAAa,CAAA;AAAA,IACjD,IAAA,CAAK,sBAAA,EAAwB,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,EAAO,GAAI,OAAA;AAErC,EAAA,IAAI,IAAA,EAAM;AACT,IAAA,IAAI,UAAA,KAAe,eAAA,CAAgB,SAAA,EAAW,OAAO,KAAK,EAAA,KAAO,oBAAA;AACjE,IAAA,OAAO,IAAA;AAAA,EACR;AAEA,EAAA,IAAI,MAAA,EAAQ;AACX,IAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,MAAA,EAAQ,MAAM,CAAA;AAC1D,IAAA,OAAO,gBAAA,IAAoB,UAAA;AAAA,EAC5B;AAEA,EAAA,OAAO,KAAA;AACR","file":"functions.js","sourcesContent":["import { promises as fs, existsSync } from \"fs\";\nimport { join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"url\";\nimport { dirname } from \"path\";\nimport { getPermissionLevel, PermissionLevel } from \"../typings/permissions.js\";\nimport { GuildMember, User } from \"discord.js\";\nimport TriviousClient from \"src/core/client/trivious.client.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Get the package root.\n *\n * @returns {string}\n */\nconst getPackageRoot = (): string => {\n\tlet dir = __dirname;\n\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \"node_modules\"))) {\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn __dirname;\n};\n\n/**\n * Framework package root.\n *\n * @type {string}\n */\nexport const FRAMEWORK_PACKAGE_ROOT = getPackageRoot();\n\n/**\n * Get the core path.\n *\n * @export\n * @param {{ userPath?: string; coreDirectory: string }} options\n * @returns {string}\n */\nexport function getCorePath(options: { userPath?: string; coreDirectory: string }): string {\n\tconst { userPath, coreDirectory } = options;\n\tif (userPath) {\n\t\treturn resolveUserPath(userPath);\n\t}\n\n\tconst builtInCandidates = [\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", coreDirectory),\n\t];\n\n\tfor (const candidate of builtInCandidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\treturn join(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory);\n}\n\n/**\n * Resolve a user given core path.\n *\n * @export\n * @param {string} relativePath\n * @returns {string}\n */\nexport function resolveUserPath(relativePath: string): string {\n\tconst candidates = [\n\t\tjoin(process.cwd(), relativePath),\n\n\t\tjoin(process.cwd(), \"lib\", relativePath),\n\t\tjoin(process.cwd(), \"dist\", relativePath),\n\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", relativePath),\n\t];\n\n\tfor (const candidate of candidates) {\n\t\tconst full = resolve(candidate);\n\t\tif (existsSync(full)) return full;\n\t}\n\n\treturn join(process.cwd(), relativePath);\n}\n\n/**\n * Whether a directory or file exists.\n *\n * @export\n * @async\n * @param {string} path\n * @returns {unknown}\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\n/**\n * Whether a user/member has permission.\n *\n * @export\n * @param {{\n * \tpermission: PermissionLevel;\n * \tuser?: User;\n * \tmember?: GuildMember;\n * }} options\n * @returns {boolean}\n */\nexport function hasPermission(\n\tclient: TriviousClient,\n\toptions: {\n\t\tpermission: PermissionLevel;\n\t\tuser?: User;\n\t\tmember?: GuildMember;\n\t}\n) {\n\tconst { permission, user, member } = options;\n\n\tif (user) {\n\t\tif (permission === PermissionLevel.BOT_OWNER) return user.id === \"424764032667484171\";\n\t\treturn true;\n\t}\n\n\tif (member) {\n\t\tconst memberPermission = getPermissionLevel(client, member);\n\t\treturn memberPermission >= permission;\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/shared/utility/functions.ts"],"names":["__filename","__dirname","fs"],"mappings":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from \"../../core/client/trivious.client.js\";\nimport { promises as fs, existsSync } from \"fs\";\nimport { join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"url\";\nimport { dirname } from \"path\";\nimport { getPermissionLevel, PermissionLevel } from \"../typings/permissions.js\";\nimport { GuildMember, User } from \"discord.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Get the package root.\n *\n * @returns {string}\n */\nconst getPackageRoot = (): string => {\n\tlet dir = __dirname;\n\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \"node_modules\"))) {\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn __dirname;\n};\n\n/**\n * Framework package root.\n *\n * @type {string}\n */\nexport const FRAMEWORK_PACKAGE_ROOT = getPackageRoot();\n\n/**\n * Get the core path.\n *\n * @export\n * @param {{ userPath?: string; coreDirectory: string }} options\n * @returns {string}\n */\nexport function getCorePath(options: { userPath?: string; coreDirectory: string }): string {\n\tconst { userPath, coreDirectory } = options;\n\tif (userPath) {\n\t\treturn resolveUserPath(userPath);\n\t}\n\n\tconst builtInCandidates = [\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", coreDirectory),\n\t];\n\n\tfor (const candidate of builtInCandidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\treturn join(FRAMEWORK_PACKAGE_ROOT, \"lib\", coreDirectory);\n}\n\n/**\n * Resolve a user given core path.\n *\n * @export\n * @param {string} relativePath\n * @returns {string}\n */\nexport function resolveUserPath(relativePath: string): string {\n\tconst candidates = [\n\t\tjoin(process.cwd(), relativePath),\n\n\t\tjoin(process.cwd(), \"lib\", relativePath),\n\t\tjoin(process.cwd(), \"dist\", relativePath),\n\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"lib\", relativePath),\n\t\tjoin(FRAMEWORK_PACKAGE_ROOT, \"dist\", relativePath),\n\t];\n\n\tfor (const candidate of candidates) {\n\t\tconst full = resolve(candidate);\n\t\tif (existsSync(full)) return full;\n\t}\n\n\treturn join(process.cwd(), relativePath);\n}\n\n/**\n * Whether a directory or file exists.\n *\n * @export\n * @async\n * @param {string} path\n * @returns {unknown}\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\n/**\n * Whether a user/member has permission.\n *\n * @export\n * @param {{\n * \tpermission: PermissionLevel;\n * \tuser?: User;\n * \tmember?: GuildMember;\n * }} options\n * @returns {boolean}\n */\nexport function hasPermission(\n\tclient: TriviousClient,\n\toptions: {\n\t\tpermission: PermissionLevel;\n\t\tuser?: User;\n\t\tmember?: GuildMember;\n\t}\n) {\n\tconst { permission, user, member } = options;\n\n\tif (user) {\n\t\tif (permission === PermissionLevel.BOT_OWNER) return user.id === \"424764032667484171\";\n\t\treturn true;\n\t}\n\n\tif (member) {\n\t\tconst memberPermission = getPermissionLevel(client, member);\n\t\treturn memberPermission >= permission;\n\t}\n\n\treturn false;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trivious",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "discord-bot",