trivious 1.3.9 → 1.3.11

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.js CHANGED
@@ -1,25 +1,39 @@
1
- import 'util';
2
- import { Collection, SlashCommandSubcommandBuilder, Client, REST, Routes, ContextMenuCommandBuilder, SlashCommandBuilder, InteractionContextType, ButtonInteraction, ModalSubmitInteraction } from 'discord.js';
3
- export { ClientEvents, Collection } from 'discord.js';
4
- import { existsSync, promises } from 'fs';
5
- import path, { dirname, join, resolve } from 'path';
6
- import { fileURLToPath, pathToFileURL } from 'url';
7
-
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined") return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __commonJS = (cb, mod) => function __require2() {
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
16
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
10
  };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
32
 
19
33
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json
20
34
  var require_package = __commonJS({
21
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json"(exports$1, module) {
22
- module.exports = {
35
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json"(exports2, module2) {
36
+ module2.exports = {
23
37
  name: "dotenv",
24
38
  version: "17.2.3",
25
39
  description: "Loads environment variables from .env file",
@@ -86,11 +100,12 @@ var require_package = __commonJS({
86
100
 
87
101
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js
88
102
  var require_main = __commonJS({
89
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js"(exports$1, module) {
90
- var fs6 = __require("fs");
91
- var path2 = __require("path");
92
- var os = __require("os");
93
- var crypto = __require("crypto");
103
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js"(exports2, module2) {
104
+ "use strict";
105
+ var fs6 = require("fs");
106
+ var path2 = require("path");
107
+ var os = require("os");
108
+ var crypto = require("crypto");
94
109
  var packageJson = require_package();
95
110
  var version = packageJson.version;
96
111
  var TIPS = [
@@ -402,20 +417,21 @@ var require_main = __commonJS({
402
417
  parse,
403
418
  populate
404
419
  };
405
- module.exports.configDotenv = DotenvModule.configDotenv;
406
- module.exports._configVault = DotenvModule._configVault;
407
- module.exports._parseVault = DotenvModule._parseVault;
408
- module.exports.config = DotenvModule.config;
409
- module.exports.decrypt = DotenvModule.decrypt;
410
- module.exports.parse = DotenvModule.parse;
411
- module.exports.populate = DotenvModule.populate;
412
- module.exports = DotenvModule;
420
+ module2.exports.configDotenv = DotenvModule.configDotenv;
421
+ module2.exports._configVault = DotenvModule._configVault;
422
+ module2.exports._parseVault = DotenvModule._parseVault;
423
+ module2.exports.config = DotenvModule.config;
424
+ module2.exports.decrypt = DotenvModule.decrypt;
425
+ module2.exports.parse = DotenvModule.parse;
426
+ module2.exports.populate = DotenvModule.populate;
427
+ module2.exports = DotenvModule;
413
428
  }
414
429
  });
415
430
 
416
431
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/env-options.js
417
432
  var require_env_options = __commonJS({
418
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/env-options.js"(exports$1, module) {
433
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/env-options.js"(exports2, module2) {
434
+ "use strict";
419
435
  var options = {};
420
436
  if (process.env.DOTENV_CONFIG_ENCODING != null) {
421
437
  options.encoding = process.env.DOTENV_CONFIG_ENCODING;
@@ -435,15 +451,16 @@ var require_env_options = __commonJS({
435
451
  if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
436
452
  options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
437
453
  }
438
- module.exports = options;
454
+ module2.exports = options;
439
455
  }
440
456
  });
441
457
 
442
458
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/cli-options.js
443
459
  var require_cli_options = __commonJS({
444
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/cli-options.js"(exports$1, module) {
460
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/cli-options.js"(exports2, module2) {
461
+ "use strict";
445
462
  var re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;
446
- module.exports = function optionMatcher(args) {
463
+ module2.exports = function optionMatcher(args) {
447
464
  const options = args.reduce(function(acc, cur) {
448
465
  const matches = cur.match(re);
449
466
  if (matches) {
@@ -459,6 +476,31 @@ var require_cli_options = __commonJS({
459
476
  }
460
477
  });
461
478
 
479
+ // src/index.ts
480
+ var index_exports = {};
481
+ __export(index_exports, {
482
+ BaseRegistry: () => BaseRegistry,
483
+ ClientEvents: () => import_discord10.ClientEvents,
484
+ Collection: () => import_discord10.Collection,
485
+ Command: () => Command,
486
+ CommandBuilder: () => CommandBuilder,
487
+ CommandRegistry: () => CommandRegistry,
488
+ Component: () => Component,
489
+ ComponentBuilder: () => ComponentBuilder,
490
+ ComponentRegistry: () => ComponentRegistry,
491
+ ComponentType: () => ComponentType,
492
+ ContextMenuBuilder: () => ContextMenuBuilder,
493
+ ContextMenuCommand: () => ContextMenuCommand,
494
+ PermissionLevel: () => PermissionLevel,
495
+ SlashCommand: () => SlashCommand,
496
+ Subcommand: () => Subcommand,
497
+ SubcommandBuilder: () => SubcommandBuilder,
498
+ TriviousClient: () => TriviousClient,
499
+ deconstructCustomId: () => deconstructCustomId,
500
+ getPermissionLevel: () => getPermissionLevel
501
+ });
502
+ module.exports = __toCommonJS(index_exports);
503
+
462
504
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/config.js
463
505
  (function() {
464
506
  require_main().config(
@@ -470,6 +512,18 @@ var require_cli_options = __commonJS({
470
512
  );
471
513
  })();
472
514
 
515
+ // src/index.ts
516
+ var import_node_util = require("util");
517
+
518
+ // src/core/client/trivious.client.ts
519
+ var import_discord6 = require("discord.js");
520
+
521
+ // src/shared/utility/functions.ts
522
+ var import_fs = require("fs");
523
+ var import_node_path = require("path");
524
+ var import_url = require("url");
525
+ var import_path = require("path");
526
+
473
527
  // src/shared/typings/permissions.ts
474
528
  var PermissionLevel = /* @__PURE__ */ ((PermissionLevel2) => {
475
529
  PermissionLevel2[PermissionLevel2["USER"] = 0] = "USER";
@@ -488,17 +542,18 @@ var getPermissionLevel = (client, member) => {
488
542
  };
489
543
 
490
544
  // src/shared/utility/functions.ts
491
- var __filename$1 = fileURLToPath(import.meta.url);
492
- var __dirname$1 = dirname(__filename$1);
545
+ var import_meta = {};
546
+ var __filename = (0, import_url.fileURLToPath)(import_meta.url);
547
+ var __dirname = (0, import_path.dirname)(__filename);
493
548
  var getPackageRoot = () => {
494
- let dir = __dirname$1;
495
- while (dir !== dirname(dir)) {
496
- if (existsSync(join(dir, "package.json")) || existsSync(join(dir, "node_modules"))) {
549
+ let dir = __dirname;
550
+ while (dir !== (0, import_path.dirname)(dir)) {
551
+ if ((0, import_fs.existsSync)((0, import_node_path.join)(dir, "package.json")) || (0, import_fs.existsSync)((0, import_node_path.join)(dir, "node_modules"))) {
497
552
  return dir;
498
553
  }
499
- dir = dirname(dir);
554
+ dir = (0, import_path.dirname)(dir);
500
555
  }
501
- return __dirname$1;
556
+ return __dirname;
502
557
  };
503
558
  var FRAMEWORK_PACKAGE_ROOT = getPackageRoot();
504
559
  function getCorePath(options) {
@@ -507,34 +562,34 @@ function getCorePath(options) {
507
562
  return resolveUserPath(userPath);
508
563
  }
509
564
  const builtInCandidates = [
510
- join(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory),
511
- join(FRAMEWORK_PACKAGE_ROOT, "dist", coreDirectory)
565
+ (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory),
566
+ (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "dist", coreDirectory)
512
567
  ];
513
568
  for (const candidate of builtInCandidates) {
514
- if (existsSync(candidate)) {
569
+ if ((0, import_fs.existsSync)(candidate)) {
515
570
  return candidate;
516
571
  }
517
572
  }
518
- return join(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory);
573
+ return (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory);
519
574
  }
520
575
  function resolveUserPath(relativePath) {
521
576
  const candidates = [
522
- join(process.cwd(), relativePath),
523
- join(process.cwd(), "lib", relativePath),
524
- join(process.cwd(), "dist", relativePath),
525
- join(FRAMEWORK_PACKAGE_ROOT, relativePath),
526
- join(FRAMEWORK_PACKAGE_ROOT, "lib", relativePath),
527
- join(FRAMEWORK_PACKAGE_ROOT, "dist", relativePath)
577
+ (0, import_node_path.join)(process.cwd(), relativePath),
578
+ (0, import_node_path.join)(process.cwd(), "lib", relativePath),
579
+ (0, import_node_path.join)(process.cwd(), "dist", relativePath),
580
+ (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, relativePath),
581
+ (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "lib", relativePath),
582
+ (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "dist", relativePath)
528
583
  ];
529
584
  for (const candidate of candidates) {
530
- const full = resolve(candidate);
531
- if (existsSync(full)) return full;
585
+ const full = (0, import_node_path.resolve)(candidate);
586
+ if ((0, import_fs.existsSync)(full)) return full;
532
587
  }
533
- return join(process.cwd(), relativePath);
588
+ return (0, import_node_path.join)(process.cwd(), relativePath);
534
589
  }
535
590
  async function exists(path2) {
536
591
  try {
537
- await promises.access(path2);
592
+ await import_fs.promises.access(path2);
538
593
  return true;
539
594
  } catch {
540
595
  return false;
@@ -552,6 +607,12 @@ function hasPermission(client, options) {
552
607
  }
553
608
  return false;
554
609
  }
610
+
611
+ // src/core/registry/command.registry.ts
612
+ var import_discord = require("discord.js");
613
+
614
+ // src/shared/typings/registry.ts
615
+ var import_url2 = require("url");
555
616
  var BaseRegistry = class {
556
617
  /**
557
618
  * Get all of loaded T
@@ -572,7 +633,7 @@ var BaseRegistry = class {
572
633
  */
573
634
  async importFile(filePath) {
574
635
  try {
575
- const { default: file } = await import(pathToFileURL(filePath).href);
636
+ const { default: file } = await import((0, import_url2.pathToFileURL)(filePath).href);
576
637
  const imports = file.default ?? file;
577
638
  if (!imports) return null;
578
639
  if (typeof imports === "function" && imports.prototype) {
@@ -601,8 +662,8 @@ var BaseRegistry = class {
601
662
  async clearCache(filePath) {
602
663
  if (process.env.NODE_ENV === "production") return;
603
664
  try {
604
- const resvoled = __require.resolve(filePath);
605
- delete __require.cache[resvoled];
665
+ const resvoled = require.resolve(filePath);
666
+ delete require.cache[resvoled];
606
667
  } catch {
607
668
  }
608
669
  }
@@ -624,8 +685,12 @@ var deconstructCustomId = (customId) => {
624
685
  tags
625
686
  };
626
687
  };
688
+
689
+ // src/core/registry/command.registry.ts
690
+ var import_fs2 = require("fs");
691
+ var import_node_path2 = require("path");
627
692
  var CommandRegistry = class extends BaseRegistry {
628
- items = new Collection();
693
+ items = new import_discord.Collection();
629
694
  /**
630
695
  * Load all commands and their subcommands
631
696
  *
@@ -637,12 +702,12 @@ var CommandRegistry = class extends BaseRegistry {
637
702
  if (!await exists(directory)) {
638
703
  return this;
639
704
  }
640
- const entries = await promises.readdir(directory, { withFileTypes: true });
705
+ const entries = await import_fs2.promises.readdir(directory, { withFileTypes: true });
641
706
  for (const entry of entries) {
642
- const fullPath = join(directory, entry.name);
707
+ const fullPath = (0, import_node_path2.join)(directory, entry.name);
643
708
  if (!entry.isDirectory()) continue;
644
- const indexFile = join(fullPath, "index.ts");
645
- const indexJs = join(fullPath, "index.js");
709
+ const indexFile = (0, import_node_path2.join)(fullPath, "index.ts");
710
+ const indexJs = (0, import_node_path2.join)(fullPath, "index.js");
646
711
  let commandFile = "";
647
712
  if (await exists(indexFile)) commandFile = indexFile;
648
713
  else if (await exists(indexJs)) commandFile = indexJs;
@@ -651,13 +716,13 @@ var CommandRegistry = class extends BaseRegistry {
651
716
  if (!command) continue;
652
717
  if (!command.metadata.active) continue;
653
718
  if (command.isSlashCommand()) {
654
- const subcommandFiles = (await promises.readdir(fullPath)).filter(
719
+ const subcommandFiles = (await import_fs2.promises.readdir(fullPath)).filter(
655
720
  (file) => (file.endsWith(".ts") || file.endsWith(".js")) && !file.startsWith("index.") && !file.endsWith(".d.ts")
656
721
  );
657
722
  for (const file of subcommandFiles) {
658
- const subcommand = await this.importFile(join(fullPath, file));
723
+ const subcommand = await this.importFile((0, import_node_path2.join)(fullPath, file));
659
724
  if (!subcommand) continue;
660
- if (!subcommand.data.name || !(subcommand.data instanceof SlashCommandSubcommandBuilder))
725
+ if (!subcommand.data.name || !(subcommand.data instanceof import_discord.SlashCommandSubcommandBuilder))
661
726
  continue;
662
727
  command.data.addSubcommand(subcommand.data);
663
728
  command.metadata.subcommands.set(subcommand.data.name, subcommand);
@@ -668,8 +733,13 @@ var CommandRegistry = class extends BaseRegistry {
668
733
  return this;
669
734
  }
670
735
  };
736
+
737
+ // src/core/registry/component.registry.ts
738
+ var import_discord2 = require("discord.js");
739
+ var import_fs3 = require("fs");
740
+ var import_node_path3 = require("path");
671
741
  var ComponentRegistry = class extends BaseRegistry {
672
- items = new Collection();
742
+ items = new import_discord2.Collection();
673
743
  /**
674
744
  * Load all components.
675
745
  *
@@ -681,15 +751,15 @@ var ComponentRegistry = class extends BaseRegistry {
681
751
  if (!await exists(directory)) {
682
752
  return this;
683
753
  }
684
- const entries = await promises.readdir(directory, { withFileTypes: true });
754
+ const entries = await import_fs3.promises.readdir(directory, { withFileTypes: true });
685
755
  for (const entry of entries) {
686
- const fullPath = join(directory, entry.name);
756
+ const fullPath = (0, import_node_path3.join)(directory, entry.name);
687
757
  if (!entry.isDirectory()) continue;
688
- const componentFiles = (await promises.readdir(fullPath)).filter(
758
+ const componentFiles = (await import_fs3.promises.readdir(fullPath)).filter(
689
759
  (file) => (file.endsWith(".ts") || file.endsWith(".js")) && !file.startsWith("index.") && !file.endsWith(".d.ts")
690
760
  );
691
761
  for (const file of componentFiles) {
692
- const component = await this.importFile(join(fullPath, file));
762
+ const component = await this.importFile((0, import_node_path3.join)(fullPath, file));
693
763
  if (!component) continue;
694
764
  const { data } = deconstructCustomId(component.metadata.customId);
695
765
  this.items.set(data, component);
@@ -698,6 +768,14 @@ var ComponentRegistry = class extends BaseRegistry {
698
768
  return this;
699
769
  }
700
770
  };
771
+
772
+ // src/core/registry/event.registry.ts
773
+ var import_discord4 = require("discord.js");
774
+ var import_fs4 = require("fs");
775
+ var import_node_path4 = require("path");
776
+
777
+ // src/core/events/interactionCreate.ts
778
+ var import_discord3 = require("discord.js");
701
779
  var interactionCreate_default = {
702
780
  name: "interactionCreate",
703
781
  execute: async (client, interaction) => {
@@ -727,9 +805,9 @@ var interactionCreate_default = {
727
805
  }
728
806
  } else if (interaction.isMessageComponent() || interaction.isModalSubmit()) {
729
807
  const { componentType, tags, data } = deconstructCustomId(interaction.customId);
730
- if (componentType === "button" /* Button */ && !(interaction instanceof ButtonInteraction))
808
+ if (componentType === "button" /* Button */ && !(interaction instanceof import_discord3.ButtonInteraction))
731
809
  return;
732
- if (componentType === "modal" /* Modal */ && !(interaction instanceof ModalSubmitInteraction))
810
+ if (componentType === "modal" /* Modal */ && !(interaction instanceof import_discord3.ModalSubmitInteraction))
733
811
  return;
734
812
  if (tags.includes("awaited")) return;
735
813
  const registeredComponents = client.registries.components.get();
@@ -756,7 +834,7 @@ var interactionCreate_default = {
756
834
 
757
835
  // src/core/registry/event.registry.ts
758
836
  var EventRegistry = class extends BaseRegistry {
759
- items = new Collection();
837
+ items = new import_discord4.Collection();
760
838
  /**
761
839
  * Load all events.
762
840
  *
@@ -766,9 +844,9 @@ var EventRegistry = class extends BaseRegistry {
766
844
  */
767
845
  async load(directory = getCorePath({ coreDirectory: "events" })) {
768
846
  if (!await exists(directory)) return this;
769
- const entries = await promises.readdir(directory, { withFileTypes: true });
847
+ const entries = await import_fs4.promises.readdir(directory, { withFileTypes: true });
770
848
  for (const entry of entries) {
771
- const fullPath = join(directory, entry.name);
849
+ const fullPath = (0, import_node_path4.join)(directory, entry.name);
772
850
  if (entry.isDirectory()) {
773
851
  await this.load(fullPath);
774
852
  continue;
@@ -779,7 +857,8 @@ var EventRegistry = class extends BaseRegistry {
779
857
  this.items.set(event.name, event);
780
858
  }
781
859
  }
782
- this.items.set(interactionCreate_default.name, interactionCreate_default);
860
+ if (!this.items.get(interactionCreate_default.name))
861
+ this.items.set(interactionCreate_default.name, interactionCreate_default);
783
862
  return this;
784
863
  }
785
864
  /**
@@ -795,8 +874,13 @@ var EventRegistry = class extends BaseRegistry {
795
874
  }
796
875
  }
797
876
  };
877
+
878
+ // src/core/registry/module.registry.ts
879
+ var import_discord5 = require("discord.js");
880
+ var import_fs5 = require("fs");
881
+ var import_node_path5 = require("path");
798
882
  var ModuleRegistry = class extends BaseRegistry {
799
- items = new Collection();
883
+ items = new import_discord5.Collection();
800
884
  /**
801
885
  * Load all modules.
802
886
  *
@@ -808,15 +892,15 @@ var ModuleRegistry = class extends BaseRegistry {
808
892
  if (!await exists(directory)) {
809
893
  return this;
810
894
  }
811
- const entries = await promises.readdir(directory, { withFileTypes: true });
895
+ const entries = await import_fs5.promises.readdir(directory, { withFileTypes: true });
812
896
  for (const entry of entries) {
813
- const fullPath = join(directory, entry.name);
897
+ const fullPath = (0, import_node_path5.join)(directory, entry.name);
814
898
  if (!entry.isDirectory()) continue;
815
- const moduleFiles = (await promises.readdir(fullPath)).filter(
899
+ const moduleFiles = (await import_fs5.promises.readdir(fullPath)).filter(
816
900
  (file) => (file.endsWith(".ts") || file.endsWith(".js")) && !file.startsWith("index.") && !file.endsWith(".d.ts")
817
901
  );
818
902
  for (const file of moduleFiles) {
819
- const moduleEvent = await this.importFile(join(fullPath, file));
903
+ const moduleEvent = await this.importFile((0, import_node_path5.join)(fullPath, file));
820
904
  if (!moduleEvent || !moduleEvent.events) continue;
821
905
  this.items.set(moduleEvent.name, moduleEvent);
822
906
  }
@@ -840,6 +924,9 @@ var ModuleRegistry = class extends BaseRegistry {
840
924
  }
841
925
  }
842
926
  };
927
+
928
+ // src/core/registry/index.ts
929
+ var import_node_path6 = __toESM(require("path"), 1);
843
930
  var registries = () => ({
844
931
  commands: new CommandRegistry(),
845
932
  components: new ComponentRegistry(),
@@ -850,16 +937,16 @@ var registries = () => ({
850
937
  const corePath = options.corePath;
851
938
  await Promise.all([
852
939
  this.commands.load(
853
- corePath ? resolveUserPath(path.join(corePath, "commands")) : corePaths?.commandsPath ? resolveUserPath(corePaths.commandsPath) : void 0
940
+ corePath ? resolveUserPath(import_node_path6.default.join(corePath, "commands")) : corePaths?.commandsPath ? resolveUserPath(corePaths.commandsPath) : void 0
854
941
  ),
855
942
  this.components.load(
856
- corePath ? resolveUserPath(path.join(corePath, "components")) : corePaths?.componentsPath ? resolveUserPath(corePaths.componentsPath) : void 0
943
+ corePath ? resolveUserPath(import_node_path6.default.join(corePath, "components")) : corePaths?.componentsPath ? resolveUserPath(corePaths.componentsPath) : void 0
857
944
  ),
858
945
  this.events.load(
859
- corePath ? resolveUserPath(path.join(corePath, "events")) : corePaths?.eventsPath ? resolveUserPath(corePaths.eventsPath) : void 0
946
+ corePath ? resolveUserPath(import_node_path6.default.join(corePath, "events")) : corePaths?.eventsPath ? resolveUserPath(corePaths.eventsPath) : void 0
860
947
  ),
861
948
  this.modules.load(
862
- corePath ? resolveUserPath(path.join(corePath, "modules")) : corePaths?.modulesPath ? resolveUserPath(corePaths.modulesPath) : void 0
949
+ corePath ? resolveUserPath(import_node_path6.default.join(corePath, "modules")) : corePaths?.modulesPath ? resolveUserPath(corePaths.modulesPath) : void 0
863
950
  )
864
951
  ]);
865
952
  },
@@ -870,7 +957,7 @@ var registries = () => ({
870
957
  });
871
958
 
872
959
  // src/core/client/trivious.client.ts
873
- var TriviousClient = class extends Client {
960
+ var TriviousClient = class extends import_discord6.Client {
874
961
  /**
875
962
  * Client registries.
876
963
  *
@@ -935,8 +1022,8 @@ var TriviousClient = class extends Client {
935
1022
  if (!clientId || !token) throw new Error("[Trivious] Invalid clientId or token reference");
936
1023
  const slashCommands = Array.from(this.registries.commands.get().values());
937
1024
  const body = [...slashCommands.map((command) => command.toJSON())];
938
- const rest = new REST({ version: "10" }).setToken(token);
939
- await rest.put(Routes.applicationCommands(clientId), { body });
1025
+ const rest = new import_discord6.REST({ version: "10" }).setToken(token);
1026
+ await rest.put(import_discord6.Routes.applicationCommands(clientId), { body });
940
1027
  console.log(`[Trivious] Deployed ${body.length} commands`);
941
1028
  }
942
1029
  /**
@@ -951,6 +1038,12 @@ var TriviousClient = class extends Client {
951
1038
  return this._options.rolePermissions ?? {};
952
1039
  }
953
1040
  };
1041
+
1042
+ // src/core/commands/command.base.ts
1043
+ var import_discord8 = require("discord.js");
1044
+
1045
+ // src/core/commands/contextcommand.base.ts
1046
+ var import_discord7 = require("discord.js");
954
1047
  var ContextMenuCommand = class extends Command {
955
1048
  /**
956
1049
  * Base command handler.
@@ -972,7 +1065,7 @@ var ContextMenuCommand = class extends Command {
972
1065
  if (memberHasPermission) await run(client, interaction);
973
1066
  }
974
1067
  };
975
- var ContextMenuBuilder = class extends ContextMenuCommandBuilder {
1068
+ var ContextMenuBuilder = class extends import_discord7.ContextMenuCommandBuilder {
976
1069
  _active = true;
977
1070
  _ownerOnly = false;
978
1071
  _permission = 0 /* USER */;
@@ -1048,7 +1141,7 @@ var Command = class {
1048
1141
  * @returns {this is SlashCommand}
1049
1142
  */
1050
1143
  isSlashCommand() {
1051
- return this.data instanceof SlashCommandBuilder && this instanceof SlashCommand;
1144
+ return this.data instanceof import_discord8.SlashCommandBuilder && this instanceof SlashCommand;
1052
1145
  }
1053
1146
  /**
1054
1147
  * Returns whether the command is a ContextMenuCommand.
@@ -1058,7 +1151,7 @@ var Command = class {
1058
1151
  * @returns {this is ContextMenuCommand}
1059
1152
  */
1060
1153
  isContextMenuCommand() {
1061
- return this.data instanceof ContextMenuCommandBuilder && this instanceof ContextMenuCommand;
1154
+ return this.data instanceof import_discord8.ContextMenuCommandBuilder && this instanceof ContextMenuCommand;
1062
1155
  }
1063
1156
  /**
1064
1157
  * Returns JSON of the command builder.
@@ -1153,12 +1246,12 @@ var SlashCommand = class extends Command {
1153
1246
  await subcommand.execute(client, interaction);
1154
1247
  }
1155
1248
  };
1156
- var CommandBuilder = class extends SlashCommandBuilder {
1249
+ var CommandBuilder = class extends import_discord8.SlashCommandBuilder {
1157
1250
  _active = true;
1158
1251
  _guildOnly = false;
1159
1252
  _ownerOnly = false;
1160
1253
  _permission = 0 /* USER */;
1161
- _subcommands = new Collection();
1254
+ _subcommands = new import_discord8.Collection();
1162
1255
  _ephemeralReply = false;
1163
1256
  /**
1164
1257
  * Set the command as disabled.
@@ -1179,7 +1272,7 @@ var CommandBuilder = class extends SlashCommandBuilder {
1179
1272
  setGuildOnly() {
1180
1273
  this._guildOnly = true;
1181
1274
  this._permission = 0 /* USER */;
1182
- this.setContexts(InteractionContextType.Guild);
1275
+ this.setContexts(import_discord8.InteractionContextType.Guild);
1183
1276
  return this;
1184
1277
  }
1185
1278
  /**
@@ -1234,7 +1327,10 @@ var CommandBuilder = class extends SlashCommandBuilder {
1234
1327
  };
1235
1328
  }
1236
1329
  };
1237
- var SubcommandBuilder = class extends SlashCommandSubcommandBuilder {
1330
+
1331
+ // src/core/commands/subcommand.base.ts
1332
+ var import_discord9 = require("discord.js");
1333
+ var SubcommandBuilder = class extends import_discord9.SlashCommandSubcommandBuilder {
1238
1334
  _active = true;
1239
1335
  _ownerOnly = false;
1240
1336
  _permission = 0 /* USER */;
@@ -1420,6 +1516,28 @@ var Component = class {
1420
1516
  }
1421
1517
  };
1422
1518
 
1423
- export { BaseRegistry, Command, CommandBuilder, CommandRegistry, Component, ComponentBuilder, ComponentRegistry, ComponentType, ContextMenuBuilder, ContextMenuCommand, PermissionLevel, SlashCommand, Subcommand, SubcommandBuilder, TriviousClient, deconstructCustomId, getPermissionLevel };
1424
- //# sourceMappingURL=index.js.map
1519
+ // src/index.ts
1520
+ var import_discord10 = require("discord.js");
1521
+ // Annotate the CommonJS export names for ESM import in node:
1522
+ 0 && (module.exports = {
1523
+ BaseRegistry,
1524
+ ClientEvents,
1525
+ Collection,
1526
+ Command,
1527
+ CommandBuilder,
1528
+ CommandRegistry,
1529
+ Component,
1530
+ ComponentBuilder,
1531
+ ComponentRegistry,
1532
+ ComponentType,
1533
+ ContextMenuBuilder,
1534
+ ContextMenuCommand,
1535
+ PermissionLevel,
1536
+ SlashCommand,
1537
+ Subcommand,
1538
+ SubcommandBuilder,
1539
+ TriviousClient,
1540
+ deconstructCustomId,
1541
+ getPermissionLevel
1542
+ });
1425
1543
  //# sourceMappingURL=index.js.map