trivious 1.3.14 → 1.3.15

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.cjs CHANGED
@@ -1,39 +1,31 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1
+ 'use strict';
2
+
3
+ require('util');
4
+ var discord_js = require('discord.js');
5
+ var fs = require('fs');
6
+ var path = require('path');
7
+ var url = require('url');
8
+
9
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var path__default = /*#__PURE__*/_interopDefault(path);
13
+
5
14
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
15
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
16
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
17
+ }) : x)(function(x) {
18
+ if (typeof require !== "undefined") return require.apply(this, arguments);
19
+ throw Error('Dynamic require of "' + x + '" is not supported');
20
+ });
21
+ var __commonJS = (cb, mod) => function __require2() {
9
22
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
23
  };
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);
32
24
 
33
25
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json
34
26
  var require_package = __commonJS({
35
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json"(exports2, module2) {
36
- module2.exports = {
27
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json"(exports$1, module) {
28
+ module.exports = {
37
29
  name: "dotenv",
38
30
  version: "17.2.3",
39
31
  description: "Loads environment variables from .env file",
@@ -100,12 +92,11 @@ var require_package = __commonJS({
100
92
 
101
93
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js
102
94
  var require_main = __commonJS({
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");
95
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js"(exports$1, module) {
96
+ var fs6 = __require("fs");
97
+ var path2 = __require("path");
98
+ var os = __require("os");
99
+ var crypto = __require("crypto");
109
100
  var packageJson = require_package();
110
101
  var version = packageJson.version;
111
102
  var TIPS = [
@@ -417,21 +408,20 @@ var require_main = __commonJS({
417
408
  parse,
418
409
  populate
419
410
  };
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;
411
+ module.exports.configDotenv = DotenvModule.configDotenv;
412
+ module.exports._configVault = DotenvModule._configVault;
413
+ module.exports._parseVault = DotenvModule._parseVault;
414
+ module.exports.config = DotenvModule.config;
415
+ module.exports.decrypt = DotenvModule.decrypt;
416
+ module.exports.parse = DotenvModule.parse;
417
+ module.exports.populate = DotenvModule.populate;
418
+ module.exports = DotenvModule;
428
419
  }
429
420
  });
430
421
 
431
422
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/env-options.js
432
423
  var require_env_options = __commonJS({
433
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/env-options.js"(exports2, module2) {
434
- "use strict";
424
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/env-options.js"(exports$1, module) {
435
425
  var options = {};
436
426
  if (process.env.DOTENV_CONFIG_ENCODING != null) {
437
427
  options.encoding = process.env.DOTENV_CONFIG_ENCODING;
@@ -451,16 +441,15 @@ var require_env_options = __commonJS({
451
441
  if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
452
442
  options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
453
443
  }
454
- module2.exports = options;
444
+ module.exports = options;
455
445
  }
456
446
  });
457
447
 
458
448
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/cli-options.js
459
449
  var require_cli_options = __commonJS({
460
- "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/cli-options.js"(exports2, module2) {
461
- "use strict";
450
+ "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/cli-options.js"(exports$1, module) {
462
451
  var re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;
463
- module2.exports = function optionMatcher(args) {
452
+ module.exports = function optionMatcher(args) {
464
453
  const options = args.reduce(function(acc, cur) {
465
454
  const matches = cur.match(re);
466
455
  if (matches) {
@@ -476,31 +465,6 @@ var require_cli_options = __commonJS({
476
465
  }
477
466
  });
478
467
 
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
-
504
468
  // node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/config.js
505
469
  (function() {
506
470
  require_main().config(
@@ -512,17 +476,6 @@ module.exports = __toCommonJS(index_exports);
512
476
  );
513
477
  })();
514
478
 
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_path2 = require("path");
525
-
526
479
  // src/shared/typings/permissions.ts
527
480
  var PermissionLevel = /* @__PURE__ */ ((PermissionLevel2) => {
528
481
  PermissionLevel2[PermissionLevel2["USER"] = 0] = "USER";
@@ -540,23 +493,18 @@ var getPermissionLevel = (client, member) => {
540
493
  return rolePermissions[highestRole.name] ?? 0 /* USER */;
541
494
  };
542
495
 
543
- // src/shared/utility/paths.ts
544
- var import_url = require("url");
545
- var import_path = require("path");
546
- var import_meta = {};
547
- var __filename = typeof _filename === "string" ? _filename : (0, import_url.fileURLToPath)(import_meta.url);
548
- var __dirname = typeof _dirname === "string" ? _dirname : (0, import_path.dirname)(__filename);
549
-
550
496
  // src/shared/utility/functions.ts
497
+ var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
498
+ var __dirname$1 = path.dirname(__filename$1);
551
499
  var getPackageRoot = () => {
552
- let dir = __dirname;
553
- while (dir !== (0, import_path2.dirname)(dir)) {
554
- 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"))) {
500
+ let dir = __dirname$1;
501
+ while (dir !== path.dirname(dir)) {
502
+ if (fs.existsSync(path.join(dir, "package.json")) || fs.existsSync(path.join(dir, "node_modules"))) {
555
503
  return dir;
556
504
  }
557
- dir = (0, import_path2.dirname)(dir);
505
+ dir = path.dirname(dir);
558
506
  }
559
- return __dirname;
507
+ return __dirname$1;
560
508
  };
561
509
  var FRAMEWORK_PACKAGE_ROOT = getPackageRoot();
562
510
  function getCorePath(options) {
@@ -565,34 +513,34 @@ function getCorePath(options) {
565
513
  return resolveUserPath(userPath);
566
514
  }
567
515
  const builtInCandidates = [
568
- (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory),
569
- (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "dist", coreDirectory)
516
+ path.join(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory),
517
+ path.join(FRAMEWORK_PACKAGE_ROOT, "dist", coreDirectory)
570
518
  ];
571
519
  for (const candidate of builtInCandidates) {
572
- if ((0, import_fs.existsSync)(candidate)) {
520
+ if (fs.existsSync(candidate)) {
573
521
  return candidate;
574
522
  }
575
523
  }
576
- return (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory);
524
+ return path.join(FRAMEWORK_PACKAGE_ROOT, "lib", coreDirectory);
577
525
  }
578
526
  function resolveUserPath(relativePath) {
579
527
  const candidates = [
580
- (0, import_node_path.join)(process.cwd(), relativePath),
581
- (0, import_node_path.join)(process.cwd(), "lib", relativePath),
582
- (0, import_node_path.join)(process.cwd(), "dist", relativePath),
583
- (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, relativePath),
584
- (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "lib", relativePath),
585
- (0, import_node_path.join)(FRAMEWORK_PACKAGE_ROOT, "dist", relativePath)
528
+ path.join(process.cwd(), relativePath),
529
+ path.join(process.cwd(), "lib", relativePath),
530
+ path.join(process.cwd(), "dist", relativePath),
531
+ path.join(FRAMEWORK_PACKAGE_ROOT, relativePath),
532
+ path.join(FRAMEWORK_PACKAGE_ROOT, "lib", relativePath),
533
+ path.join(FRAMEWORK_PACKAGE_ROOT, "dist", relativePath)
586
534
  ];
587
535
  for (const candidate of candidates) {
588
- const full = (0, import_node_path.resolve)(candidate);
589
- if ((0, import_fs.existsSync)(full)) return full;
536
+ const full = path.resolve(candidate);
537
+ if (fs.existsSync(full)) return full;
590
538
  }
591
- return (0, import_node_path.join)(process.cwd(), relativePath);
539
+ return path.join(process.cwd(), relativePath);
592
540
  }
593
541
  async function exists(path2) {
594
542
  try {
595
- await import_fs.promises.access(path2);
543
+ await fs.promises.access(path2);
596
544
  return true;
597
545
  } catch {
598
546
  return false;
@@ -610,12 +558,6 @@ function hasPermission(client, options) {
610
558
  }
611
559
  return false;
612
560
  }
613
-
614
- // src/core/registry/command.registry.ts
615
- var import_discord = require("discord.js");
616
-
617
- // src/shared/typings/registry.ts
618
- var import_url2 = require("url");
619
561
  var BaseRegistry = class {
620
562
  /**
621
563
  * Get all of loaded T
@@ -636,7 +578,7 @@ var BaseRegistry = class {
636
578
  */
637
579
  async importFile(filePath) {
638
580
  try {
639
- const { default: file } = await import((0, import_url2.pathToFileURL)(filePath).href);
581
+ const { default: file } = await import(url.pathToFileURL(filePath).href);
640
582
  const imports = file.default ?? file;
641
583
  if (!imports) return null;
642
584
  if (typeof imports === "function" && imports.prototype) {
@@ -665,8 +607,8 @@ var BaseRegistry = class {
665
607
  async clearCache(filePath) {
666
608
  if (process.env.NODE_ENV === "production") return;
667
609
  try {
668
- const resvoled = require.resolve(filePath);
669
- delete require.cache[resvoled];
610
+ const resvoled = __require.resolve(filePath);
611
+ delete __require.cache[resvoled];
670
612
  } catch {
671
613
  }
672
614
  }
@@ -688,12 +630,8 @@ var deconstructCustomId = (customId) => {
688
630
  tags
689
631
  };
690
632
  };
691
-
692
- // src/core/registry/command.registry.ts
693
- var import_fs2 = require("fs");
694
- var import_node_path2 = require("path");
695
633
  var CommandRegistry = class extends BaseRegistry {
696
- items = new import_discord.Collection();
634
+ items = new discord_js.Collection();
697
635
  /**
698
636
  * Load all commands and their subcommands
699
637
  *
@@ -705,12 +643,12 @@ var CommandRegistry = class extends BaseRegistry {
705
643
  if (!await exists(directory)) {
706
644
  return this;
707
645
  }
708
- const entries = await import_fs2.promises.readdir(directory, { withFileTypes: true });
646
+ const entries = await fs.promises.readdir(directory, { withFileTypes: true });
709
647
  for (const entry of entries) {
710
- const fullPath = (0, import_node_path2.join)(directory, entry.name);
648
+ const fullPath = path.join(directory, entry.name);
711
649
  if (!entry.isDirectory()) continue;
712
- const indexFile = (0, import_node_path2.join)(fullPath, "index.ts");
713
- const indexJs = (0, import_node_path2.join)(fullPath, "index.js");
650
+ const indexFile = path.join(fullPath, "index.ts");
651
+ const indexJs = path.join(fullPath, "index.js");
714
652
  let commandFile = "";
715
653
  if (await exists(indexFile)) commandFile = indexFile;
716
654
  else if (await exists(indexJs)) commandFile = indexJs;
@@ -719,13 +657,13 @@ var CommandRegistry = class extends BaseRegistry {
719
657
  if (!command) continue;
720
658
  if (!command.metadata.active) continue;
721
659
  if (command.isSlashCommand()) {
722
- const subcommandFiles = (await import_fs2.promises.readdir(fullPath)).filter(
660
+ const subcommandFiles = (await fs.promises.readdir(fullPath)).filter(
723
661
  (file) => (file.endsWith(".ts") || file.endsWith(".js")) && !file.startsWith("index.") && !file.endsWith(".d.ts")
724
662
  );
725
663
  for (const file of subcommandFiles) {
726
- const subcommand = await this.importFile((0, import_node_path2.join)(fullPath, file));
664
+ const subcommand = await this.importFile(path.join(fullPath, file));
727
665
  if (!subcommand) continue;
728
- if (!subcommand.data.name || !(subcommand.data instanceof import_discord.SlashCommandSubcommandBuilder))
666
+ if (!subcommand.data.name || !(subcommand.data instanceof discord_js.SlashCommandSubcommandBuilder))
729
667
  continue;
730
668
  command.data.addSubcommand(subcommand.data);
731
669
  command.metadata.subcommands.set(subcommand.data.name, subcommand);
@@ -736,13 +674,8 @@ var CommandRegistry = class extends BaseRegistry {
736
674
  return this;
737
675
  }
738
676
  };
739
-
740
- // src/core/registry/component.registry.ts
741
- var import_discord2 = require("discord.js");
742
- var import_fs3 = require("fs");
743
- var import_node_path3 = require("path");
744
677
  var ComponentRegistry = class extends BaseRegistry {
745
- items = new import_discord2.Collection();
678
+ items = new discord_js.Collection();
746
679
  /**
747
680
  * Load all components.
748
681
  *
@@ -754,15 +687,15 @@ var ComponentRegistry = class extends BaseRegistry {
754
687
  if (!await exists(directory)) {
755
688
  return this;
756
689
  }
757
- const entries = await import_fs3.promises.readdir(directory, { withFileTypes: true });
690
+ const entries = await fs.promises.readdir(directory, { withFileTypes: true });
758
691
  for (const entry of entries) {
759
- const fullPath = (0, import_node_path3.join)(directory, entry.name);
692
+ const fullPath = path.join(directory, entry.name);
760
693
  if (!entry.isDirectory()) continue;
761
- const componentFiles = (await import_fs3.promises.readdir(fullPath)).filter(
694
+ const componentFiles = (await fs.promises.readdir(fullPath)).filter(
762
695
  (file) => (file.endsWith(".ts") || file.endsWith(".js")) && !file.startsWith("index.") && !file.endsWith(".d.ts")
763
696
  );
764
697
  for (const file of componentFiles) {
765
- const component = await this.importFile((0, import_node_path3.join)(fullPath, file));
698
+ const component = await this.importFile(path.join(fullPath, file));
766
699
  if (!component) continue;
767
700
  const { data } = deconstructCustomId(component.metadata.customId);
768
701
  this.items.set(data, component);
@@ -771,14 +704,6 @@ var ComponentRegistry = class extends BaseRegistry {
771
704
  return this;
772
705
  }
773
706
  };
774
-
775
- // src/core/registry/event.registry.ts
776
- var import_discord4 = require("discord.js");
777
- var import_fs4 = require("fs");
778
- var import_node_path4 = require("path");
779
-
780
- // src/core/events/interactionCreate.ts
781
- var import_discord3 = require("discord.js");
782
707
  var interactionCreate_default = {
783
708
  name: "interactionCreate",
784
709
  execute: async (client, interaction) => {
@@ -808,9 +733,9 @@ var interactionCreate_default = {
808
733
  }
809
734
  } else if (interaction.isMessageComponent() || interaction.isModalSubmit()) {
810
735
  const { componentType, tags, data } = deconstructCustomId(interaction.customId);
811
- if (componentType === "button" /* Button */ && !(interaction instanceof import_discord3.ButtonInteraction))
736
+ if (componentType === "button" /* Button */ && !(interaction instanceof discord_js.ButtonInteraction))
812
737
  return;
813
- if (componentType === "modal" /* Modal */ && !(interaction instanceof import_discord3.ModalSubmitInteraction))
738
+ if (componentType === "modal" /* Modal */ && !(interaction instanceof discord_js.ModalSubmitInteraction))
814
739
  return;
815
740
  if (tags.includes("awaited")) return;
816
741
  const registeredComponents = client.registries.components.get();
@@ -837,7 +762,7 @@ var interactionCreate_default = {
837
762
 
838
763
  // src/core/registry/event.registry.ts
839
764
  var EventRegistry = class extends BaseRegistry {
840
- items = new import_discord4.Collection();
765
+ items = new discord_js.Collection();
841
766
  /**
842
767
  * Load all events.
843
768
  *
@@ -847,9 +772,9 @@ var EventRegistry = class extends BaseRegistry {
847
772
  */
848
773
  async load(directory = getCorePath({ coreDirectory: "events" })) {
849
774
  if (!await exists(directory)) return this;
850
- const entries = await import_fs4.promises.readdir(directory, { withFileTypes: true });
775
+ const entries = await fs.promises.readdir(directory, { withFileTypes: true });
851
776
  for (const entry of entries) {
852
- const fullPath = (0, import_node_path4.join)(directory, entry.name);
777
+ const fullPath = path.join(directory, entry.name);
853
778
  if (entry.isDirectory()) {
854
779
  await this.load(fullPath);
855
780
  continue;
@@ -860,8 +785,7 @@ var EventRegistry = class extends BaseRegistry {
860
785
  this.items.set(event.name, event);
861
786
  }
862
787
  }
863
- if (!this.items.get(interactionCreate_default.name))
864
- this.items.set(interactionCreate_default.name, interactionCreate_default);
788
+ this.items.set(interactionCreate_default.name, interactionCreate_default);
865
789
  return this;
866
790
  }
867
791
  /**
@@ -877,13 +801,8 @@ var EventRegistry = class extends BaseRegistry {
877
801
  }
878
802
  }
879
803
  };
880
-
881
- // src/core/registry/module.registry.ts
882
- var import_discord5 = require("discord.js");
883
- var import_fs5 = require("fs");
884
- var import_node_path5 = require("path");
885
804
  var ModuleRegistry = class extends BaseRegistry {
886
- items = new import_discord5.Collection();
805
+ items = new discord_js.Collection();
887
806
  /**
888
807
  * Load all modules.
889
808
  *
@@ -895,15 +814,15 @@ var ModuleRegistry = class extends BaseRegistry {
895
814
  if (!await exists(directory)) {
896
815
  return this;
897
816
  }
898
- const entries = await import_fs5.promises.readdir(directory, { withFileTypes: true });
817
+ const entries = await fs.promises.readdir(directory, { withFileTypes: true });
899
818
  for (const entry of entries) {
900
- const fullPath = (0, import_node_path5.join)(directory, entry.name);
819
+ const fullPath = path.join(directory, entry.name);
901
820
  if (!entry.isDirectory()) continue;
902
- const moduleFiles = (await import_fs5.promises.readdir(fullPath)).filter(
821
+ const moduleFiles = (await fs.promises.readdir(fullPath)).filter(
903
822
  (file) => (file.endsWith(".ts") || file.endsWith(".js")) && !file.startsWith("index.") && !file.endsWith(".d.ts")
904
823
  );
905
824
  for (const file of moduleFiles) {
906
- const moduleEvent = await this.importFile((0, import_node_path5.join)(fullPath, file));
825
+ const moduleEvent = await this.importFile(path.join(fullPath, file));
907
826
  if (!moduleEvent || !moduleEvent.events) continue;
908
827
  this.items.set(moduleEvent.name, moduleEvent);
909
828
  }
@@ -927,9 +846,6 @@ var ModuleRegistry = class extends BaseRegistry {
927
846
  }
928
847
  }
929
848
  };
930
-
931
- // src/core/registry/index.ts
932
- var import_node_path6 = __toESM(require("path"), 1);
933
849
  var registries = () => ({
934
850
  commands: new CommandRegistry(),
935
851
  components: new ComponentRegistry(),
@@ -940,16 +856,16 @@ var registries = () => ({
940
856
  const corePath = options.corePath;
941
857
  await Promise.all([
942
858
  this.commands.load(
943
- corePath ? resolveUserPath(import_node_path6.default.join(corePath, "commands")) : corePaths?.commandsPath ? resolveUserPath(corePaths.commandsPath) : void 0
859
+ corePath ? resolveUserPath(path__default.default.join(corePath, "commands")) : corePaths?.commandsPath ? resolveUserPath(corePaths.commandsPath) : void 0
944
860
  ),
945
861
  this.components.load(
946
- corePath ? resolveUserPath(import_node_path6.default.join(corePath, "components")) : corePaths?.componentsPath ? resolveUserPath(corePaths.componentsPath) : void 0
862
+ corePath ? resolveUserPath(path__default.default.join(corePath, "components")) : corePaths?.componentsPath ? resolveUserPath(corePaths.componentsPath) : void 0
947
863
  ),
948
864
  this.events.load(
949
- corePath ? resolveUserPath(import_node_path6.default.join(corePath, "events")) : corePaths?.eventsPath ? resolveUserPath(corePaths.eventsPath) : void 0
865
+ corePath ? resolveUserPath(path__default.default.join(corePath, "events")) : corePaths?.eventsPath ? resolveUserPath(corePaths.eventsPath) : void 0
950
866
  ),
951
867
  this.modules.load(
952
- corePath ? resolveUserPath(import_node_path6.default.join(corePath, "modules")) : corePaths?.modulesPath ? resolveUserPath(corePaths.modulesPath) : void 0
868
+ corePath ? resolveUserPath(path__default.default.join(corePath, "modules")) : corePaths?.modulesPath ? resolveUserPath(corePaths.modulesPath) : void 0
953
869
  )
954
870
  ]);
955
871
  },
@@ -960,7 +876,7 @@ var registries = () => ({
960
876
  });
961
877
 
962
878
  // src/core/client/trivious.client.ts
963
- var TriviousClient = class extends import_discord6.Client {
879
+ var TriviousClient = class extends discord_js.Client {
964
880
  /**
965
881
  * Client registries.
966
882
  *
@@ -1025,8 +941,8 @@ var TriviousClient = class extends import_discord6.Client {
1025
941
  if (!clientId || !token) throw new Error("[Trivious] Invalid clientId or token reference");
1026
942
  const slashCommands = Array.from(this.registries.commands.get().values());
1027
943
  const body = [...slashCommands.map((command) => command.toJSON())];
1028
- const rest = new import_discord6.REST({ version: "10" }).setToken(token);
1029
- await rest.put(import_discord6.Routes.applicationCommands(clientId), { body });
944
+ const rest = new discord_js.REST({ version: "10" }).setToken(token);
945
+ await rest.put(discord_js.Routes.applicationCommands(clientId), { body });
1030
946
  console.log(`[Trivious] Deployed ${body.length} commands`);
1031
947
  }
1032
948
  /**
@@ -1041,100 +957,6 @@ var TriviousClient = class extends import_discord6.Client {
1041
957
  return this._options.rolePermissions ?? {};
1042
958
  }
1043
959
  };
1044
-
1045
- // src/core/commands/command.base.ts
1046
- var import_discord8 = require("discord.js");
1047
-
1048
- // src/core/commands/contextcommand.base.ts
1049
- var import_discord7 = require("discord.js");
1050
- var ContextMenuCommand = class extends Command {
1051
- /**
1052
- * Base command handler.
1053
- *
1054
- * @public
1055
- * @async
1056
- * @param {TriviousClient} client
1057
- * @param {ContextMenuCommandInteraction} interaction
1058
- * @returns {*}
1059
- */
1060
- async execute(client, interaction) {
1061
- const { run, metadata } = this;
1062
- const memberHasPermission = await this.validateGuildPermission(
1063
- client,
1064
- interaction,
1065
- metadata.permission,
1066
- false
1067
- );
1068
- if (memberHasPermission) await run(client, interaction);
1069
- }
1070
- };
1071
- var ContextMenuBuilder = class extends import_discord7.ContextMenuCommandBuilder {
1072
- _active = true;
1073
- _ownerOnly = false;
1074
- _permission = 0 /* USER */;
1075
- _ephemeralReply = false;
1076
- /**
1077
- * Set the command as disabled.
1078
- *
1079
- * @public
1080
- * @returns {this}
1081
- */
1082
- disable() {
1083
- this._active = false;
1084
- return this;
1085
- }
1086
- /**
1087
- * Set the command as owner only.
1088
- *
1089
- * @public
1090
- * @returns {this}
1091
- */
1092
- setOwnerOnly() {
1093
- this._permission = 5 /* BOT_OWNER */;
1094
- this._ownerOnly = true;
1095
- return this;
1096
- }
1097
- /**
1098
- * Set the permission level required to run the command.
1099
- *
1100
- * @public
1101
- * @param {PermissionLevel} permission
1102
- * @returns {this}
1103
- */
1104
- setPermission(permission) {
1105
- this._permission = permission;
1106
- return this;
1107
- }
1108
- /**
1109
- * Set the interaction as ephemeral.
1110
- *
1111
- * @public
1112
- * @returns {this}
1113
- */
1114
- setEphemeralReply() {
1115
- this._ephemeralReply = true;
1116
- return this;
1117
- }
1118
- /**
1119
- * Build the builder
1120
- *
1121
- * @public
1122
- * @returns {{ data: ContextMenuBuilder; metadata: ContextMenuMetadata; }}
1123
- */
1124
- build() {
1125
- return {
1126
- data: this,
1127
- metadata: {
1128
- active: this._active,
1129
- ownerOnly: this._ownerOnly,
1130
- permission: this._permission,
1131
- ephemeralReply: this._ephemeralReply
1132
- }
1133
- };
1134
- }
1135
- };
1136
-
1137
- // src/core/commands/command.base.ts
1138
960
  var Command = class {
1139
961
  /**
1140
962
  * Returns whether the command is a SlashCommand.
@@ -1144,7 +966,7 @@ var Command = class {
1144
966
  * @returns {this is SlashCommand}
1145
967
  */
1146
968
  isSlashCommand() {
1147
- return this.data instanceof import_discord8.SlashCommandBuilder && this instanceof SlashCommand;
969
+ return this.data instanceof discord_js.SlashCommandBuilder;
1148
970
  }
1149
971
  /**
1150
972
  * Returns whether the command is a ContextMenuCommand.
@@ -1154,7 +976,7 @@ var Command = class {
1154
976
  * @returns {this is ContextMenuCommand}
1155
977
  */
1156
978
  isContextMenuCommand() {
1157
- return this.data instanceof import_discord8.ContextMenuCommandBuilder && this instanceof ContextMenuCommand;
979
+ return this.data instanceof discord_js.ContextMenuCommandBuilder;
1158
980
  }
1159
981
  /**
1160
982
  * Returns JSON of the command builder.
@@ -1207,54 +1029,12 @@ var Command = class {
1207
1029
  return memberHasPermission;
1208
1030
  }
1209
1031
  };
1210
- var SlashCommand = class extends Command {
1211
- /**
1212
- * General handler for the command and its subcommand, if applicable.
1213
- *
1214
- * @public
1215
- * @async
1216
- * @param {TriviousClient} client
1217
- * @param {ChatInputCommandInteraction} interaction
1218
- * @returns {*}
1219
- */
1220
- async execute(client, interaction) {
1221
- const { run, reply, metadata } = this;
1222
- const { options } = interaction;
1223
- if (run) {
1224
- const memberHasPermission2 = await this.validateGuildPermission(
1225
- client,
1226
- interaction,
1227
- metadata.permission,
1228
- false
1229
- );
1230
- if (memberHasPermission2) await run(client, interaction);
1231
- }
1232
- const subcommands = metadata.subcommands;
1233
- if (subcommands.size <= 0) return;
1234
- const subcommand = metadata.subcommands.find(
1235
- (subcmd) => subcmd.data.name === options.getSubcommand()
1236
- );
1237
- if (!subcommand) {
1238
- await reply(interaction, {
1239
- content: "Ran subcommand is outdated or does not have a handler!"
1240
- });
1241
- return;
1242
- }
1243
- const memberHasPermission = await this.validateGuildPermission(
1244
- client,
1245
- interaction,
1246
- subcommand.metadata.permission
1247
- );
1248
- if (!memberHasPermission) return;
1249
- await subcommand.execute(client, interaction);
1250
- }
1251
- };
1252
- var CommandBuilder = class extends import_discord8.SlashCommandBuilder {
1032
+ var CommandBuilder = class extends discord_js.SlashCommandBuilder {
1253
1033
  _active = true;
1254
1034
  _guildOnly = false;
1255
1035
  _ownerOnly = false;
1256
1036
  _permission = 0 /* USER */;
1257
- _subcommands = new import_discord8.Collection();
1037
+ _subcommands = new discord_js.Collection();
1258
1038
  _ephemeralReply = false;
1259
1039
  /**
1260
1040
  * Set the command as disabled.
@@ -1275,7 +1055,7 @@ var CommandBuilder = class extends import_discord8.SlashCommandBuilder {
1275
1055
  setGuildOnly() {
1276
1056
  this._guildOnly = true;
1277
1057
  this._permission = 0 /* USER */;
1278
- this.setContexts(import_discord8.InteractionContextType.Guild);
1058
+ this.setContexts(discord_js.InteractionContextType.Guild);
1279
1059
  return this;
1280
1060
  }
1281
1061
  /**
@@ -1330,10 +1110,7 @@ var CommandBuilder = class extends import_discord8.SlashCommandBuilder {
1330
1110
  };
1331
1111
  }
1332
1112
  };
1333
-
1334
- // src/core/commands/subcommand.base.ts
1335
- var import_discord9 = require("discord.js");
1336
- var SubcommandBuilder = class extends import_discord9.SlashCommandSubcommandBuilder {
1113
+ var SubcommandBuilder = class extends discord_js.SlashCommandSubcommandBuilder {
1337
1114
  _active = true;
1338
1115
  _ownerOnly = false;
1339
1116
  _permission = 0 /* USER */;
@@ -1417,6 +1194,92 @@ var Subcommand = class {
1417
1194
  await interaction.reply(newOptions);
1418
1195
  }
1419
1196
  };
1197
+ var ContextMenuCommand = class extends Command {
1198
+ /**
1199
+ * Base command handler.
1200
+ *
1201
+ * @public
1202
+ * @async
1203
+ * @param {TriviousClient} client
1204
+ * @param {ContextMenuCommandInteraction} interaction
1205
+ * @returns {*}
1206
+ */
1207
+ async execute(client, interaction) {
1208
+ const { run, metadata } = this;
1209
+ const memberHasPermission = await this.validateGuildPermission(
1210
+ client,
1211
+ interaction,
1212
+ metadata.permission,
1213
+ false
1214
+ );
1215
+ if (memberHasPermission) await run(client, interaction);
1216
+ }
1217
+ };
1218
+ var ContextMenuBuilder = class extends discord_js.ContextMenuCommandBuilder {
1219
+ _active = true;
1220
+ _ownerOnly = false;
1221
+ _permission = 0 /* USER */;
1222
+ _ephemeralReply = false;
1223
+ /**
1224
+ * Set the command as disabled.
1225
+ *
1226
+ * @public
1227
+ * @returns {this}
1228
+ */
1229
+ disable() {
1230
+ this._active = false;
1231
+ return this;
1232
+ }
1233
+ /**
1234
+ * Set the command as owner only.
1235
+ *
1236
+ * @public
1237
+ * @returns {this}
1238
+ */
1239
+ setOwnerOnly() {
1240
+ this._permission = 5 /* BOT_OWNER */;
1241
+ this._ownerOnly = true;
1242
+ return this;
1243
+ }
1244
+ /**
1245
+ * Set the permission level required to run the command.
1246
+ *
1247
+ * @public
1248
+ * @param {PermissionLevel} permission
1249
+ * @returns {this}
1250
+ */
1251
+ setPermission(permission) {
1252
+ this._permission = permission;
1253
+ return this;
1254
+ }
1255
+ /**
1256
+ * Set the interaction as ephemeral.
1257
+ *
1258
+ * @public
1259
+ * @returns {this}
1260
+ */
1261
+ setEphemeralReply() {
1262
+ this._ephemeralReply = true;
1263
+ return this;
1264
+ }
1265
+ /**
1266
+ * Build the builder
1267
+ *
1268
+ * @public
1269
+ * @returns {{ data: ContextMenuBuilder; metadata: ContextMenuMetadata; }}
1270
+ */
1271
+ build() {
1272
+ return {
1273
+ data: this,
1274
+ metadata: {
1275
+ active: this._active,
1276
+ ownerOnly: this._ownerOnly,
1277
+ permission: this._permission,
1278
+ ephemeralReply: this._ephemeralReply
1279
+ }
1280
+ };
1281
+ }
1282
+ };
1420
1283
 
1421
1284
  // src/core/components/component.base.ts
1422
1285
  var ComponentBuilder = class {
@@ -1519,28 +1382,29 @@ var Component = class {
1519
1382
  }
1520
1383
  };
1521
1384
 
1522
- // src/index.ts
1523
- var import_discord10 = require("discord.js");
1524
- // Annotate the CommonJS export names for ESM import in node:
1525
- 0 && (module.exports = {
1526
- BaseRegistry,
1527
- ClientEvents,
1528
- Collection,
1529
- Command,
1530
- CommandBuilder,
1531
- CommandRegistry,
1532
- Component,
1533
- ComponentBuilder,
1534
- ComponentRegistry,
1535
- ComponentType,
1536
- ContextMenuBuilder,
1537
- ContextMenuCommand,
1538
- PermissionLevel,
1539
- SlashCommand,
1540
- Subcommand,
1541
- SubcommandBuilder,
1542
- TriviousClient,
1543
- deconstructCustomId,
1544
- getPermissionLevel
1385
+ Object.defineProperty(exports, "ClientEvents", {
1386
+ enumerable: true,
1387
+ get: function () { return discord_js.ClientEvents; }
1388
+ });
1389
+ Object.defineProperty(exports, "Collection", {
1390
+ enumerable: true,
1391
+ get: function () { return discord_js.Collection; }
1545
1392
  });
1393
+ exports.BaseRegistry = BaseRegistry;
1394
+ exports.Command = Command;
1395
+ exports.CommandBuilder = CommandBuilder;
1396
+ exports.CommandRegistry = CommandRegistry;
1397
+ exports.Component = Component;
1398
+ exports.ComponentBuilder = ComponentBuilder;
1399
+ exports.ComponentRegistry = ComponentRegistry;
1400
+ exports.ComponentType = ComponentType;
1401
+ exports.ContextMenuBuilder = ContextMenuBuilder;
1402
+ exports.ContextMenuCommand = ContextMenuCommand;
1403
+ exports.PermissionLevel = PermissionLevel;
1404
+ exports.Subcommand = Subcommand;
1405
+ exports.SubcommandBuilder = SubcommandBuilder;
1406
+ exports.TriviousClient = TriviousClient;
1407
+ exports.deconstructCustomId = deconstructCustomId;
1408
+ exports.getPermissionLevel = getPermissionLevel;
1409
+ //# sourceMappingURL=index.cjs.map
1546
1410
  //# sourceMappingURL=index.cjs.map