trivious 2.2.4 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/features/builders/utility.builders.js +8 -5
  2. package/dist/features/builders/utility.builders.js.map +1 -1
  3. package/dist/features/client/client.types.js +0 -2
  4. package/dist/features/client/client.types.js.map +1 -1
  5. package/dist/features/client/deploy.client.d.ts +1 -1
  6. package/dist/features/client/deploy.client.js +8 -9
  7. package/dist/features/client/deploy.client.js.map +1 -1
  8. package/dist/features/client/trivious.client.d.ts +1 -1
  9. package/dist/features/client/trivious.client.js +8 -9
  10. package/dist/features/client/trivious.client.js.map +1 -1
  11. package/dist/features/commands/builders.commands.d.ts +5 -5
  12. package/dist/features/commands/builders.commands.js +10 -5
  13. package/dist/features/commands/builders.commands.js.map +1 -1
  14. package/dist/features/commands/commands.types.d.ts +1 -1
  15. package/dist/features/commands/commands.types.js +0 -2
  16. package/dist/features/commands/commands.types.js.map +1 -1
  17. package/dist/features/commands/methods.commands.d.ts +1 -1
  18. package/dist/features/commands/methods.commands.js +4 -3
  19. package/dist/features/commands/methods.commands.js.map +1 -1
  20. package/dist/features/commands/registry.commands.d.ts +1 -1
  21. package/dist/features/commands/registry.commands.js +92 -79
  22. package/dist/features/commands/registry.commands.js.map +1 -1
  23. package/dist/features/components/builders.components.d.ts +1 -1
  24. package/dist/features/components/builders.components.js +7 -5
  25. package/dist/features/components/builders.components.js.map +1 -1
  26. package/dist/features/components/components.types.d.ts +1 -1
  27. package/dist/features/components/components.types.js +3 -3
  28. package/dist/features/components/components.types.js.map +1 -1
  29. package/dist/features/components/registry.components.d.ts +1 -1
  30. package/dist/features/components/registry.components.js +9 -10
  31. package/dist/features/components/registry.components.js.map +1 -1
  32. package/dist/features/customId/customid.types.d.ts +1 -1
  33. package/dist/features/customId/customid.types.js +0 -2
  34. package/dist/features/customId/customid.types.js.map +1 -1
  35. package/dist/features/customId/methods.customid.d.ts +1 -1
  36. package/dist/features/customId/methods.customid.js +4 -5
  37. package/dist/features/customId/methods.customid.js.map +1 -1
  38. package/dist/features/events/builders.events.d.ts +1 -1
  39. package/dist/features/events/builders.events.js +4 -3
  40. package/dist/features/events/builders.events.js.map +1 -1
  41. package/dist/features/events/events.types.d.ts +1 -1
  42. package/dist/features/events/events.types.js +0 -2
  43. package/dist/features/events/events.types.js.map +1 -1
  44. package/dist/features/events/presets/clientReady.d.ts +1 -1
  45. package/dist/features/events/presets/clientReady.js +3 -3
  46. package/dist/features/events/presets/clientReady.js.map +1 -1
  47. package/dist/features/events/presets/interactionCreate.d.ts +1 -1
  48. package/dist/features/events/presets/interactionCreate.js +14 -9
  49. package/dist/features/events/presets/interactionCreate.js.map +1 -1
  50. package/dist/features/events/registry.events.d.ts +1 -1
  51. package/dist/features/events/registry.events.js +10 -10
  52. package/dist/features/events/registry.events.js.map +1 -1
  53. package/dist/features/modules/builders.modules.d.ts +1 -1
  54. package/dist/features/modules/builders.modules.js +3 -3
  55. package/dist/features/modules/builders.modules.js.map +1 -1
  56. package/dist/features/modules/modules.types.d.ts +1 -1
  57. package/dist/features/modules/modules.types.js +0 -2
  58. package/dist/features/modules/modules.types.js.map +1 -1
  59. package/dist/features/modules/registry.modules.d.ts +1 -1
  60. package/dist/features/modules/registry.modules.js +9 -9
  61. package/dist/features/modules/registry.modules.js.map +1 -1
  62. package/dist/features/permissions/methods.permissions.d.ts +1 -1
  63. package/dist/features/permissions/methods.permissions.js +4 -3
  64. package/dist/features/permissions/methods.permissions.js.map +1 -1
  65. package/dist/features/permissions/permissions.types.d.ts +1 -3
  66. package/dist/features/permissions/permissions.types.js +0 -2
  67. package/dist/features/permissions/permissions.types.js.map +1 -1
  68. package/dist/features/structure/index.structure.js +11 -12
  69. package/dist/features/structure/index.structure.js.map +1 -1
  70. package/dist/index.d.ts +1 -1
  71. package/dist/index.js +11 -9
  72. package/dist/index.js.map +1 -1
  73. package/dist/{modules.types-lYoNHt-m.d.ts → modules.types-STECtgbF.d.ts} +12 -6
  74. package/dist/shared/registries.d.ts +1 -1
  75. package/dist/shared/registries.js +7 -8
  76. package/dist/shared/registries.js.map +1 -1
  77. package/dist/shared/typings.d.ts +1 -1
  78. package/dist/shared/typings.js +11 -9
  79. package/dist/shared/typings.js.map +1 -1
  80. package/dist/utility/errors.d.ts +1 -1
  81. package/dist/utility/errors.js +4 -3
  82. package/dist/utility/errors.js.map +1 -1
  83. package/dist/utility/functions.js +7 -7
  84. package/dist/utility/functions.js.map +1 -1
  85. package/package.json +9 -5
@@ -4,7 +4,7 @@ var ComponentContext = /* @__PURE__ */ ((ComponentContext2) => {
4
4
  ComponentContext2[ComponentContext2["Modal"] = 2] = "Modal";
5
5
  return ComponentContext2;
6
6
  })(ComponentContext || {});
7
-
8
- export { ComponentContext };
9
- //# sourceMappingURL=components.types.js.map
7
+ export {
8
+ ComponentContext
9
+ };
10
10
  //# sourceMappingURL=components.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/components/components.types.ts"],"names":["ComponentContext"],"mappings":"AASO,IAAK,gBAAA,qBAAAA,iBAAAA,KAAL;AACN,EAAAA,iBAAAA,CAAAA,iBAAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA;AACA,EAAAA,iBAAAA,CAAAA,iBAAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAA;AACA,EAAAA,iBAAAA,CAAAA,iBAAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AAHW,EAAA,OAAAA,iBAAAA;AAAA,CAAA,EAAA,gBAAA,IAAA,EAAA","file":"components.types.js","sourcesContent":["import { CommandPermissionValues, TriviousClient } from \"#typings\";\nimport { AnySelectMenuInteraction, ButtonInteraction, ModalSubmitInteraction } from \"discord.js\";\n\nexport type ComponentFlags = \"Cached\" | \"DeferReply\" | \"EphemeralReply\" | \"ExpectModal\";\nexport type ComponentInteraction =\n\t| AnySelectMenuInteraction\n\t| ButtonInteraction\n\t| ModalSubmitInteraction;\n\nexport enum ComponentContext {\n\tButton,\n\tSelectMenu,\n\tModal,\n}\n\ntype ContextualComponentInteraction<Context extends ComponentContext = ComponentContext> =\n\tContext extends ComponentContext.Button\n\t\t? ButtonInteraction\n\t\t: Context extends ComponentContext.SelectMenu\n\t\t\t? AnySelectMenuInteraction\n\t\t\t: Context extends ComponentContext.Modal\n\t\t\t\t? ModalSubmitInteraction\n\t\t\t\t: ComponentInteraction;\n\n/**\n * Trivious component\n * @param context The component context\n * @param identifier The unique identifier inside the custom id\n * @param flags The component flags\n * @param execute Component handler\n */\nexport interface Component<Context extends ComponentContext = ComponentContext> {\n\t/**\n\t * @deprecated Use context instead\n\t */\n\tcomponent?: Context;\n\tcontext: Context;\n\tidentifier: string;\n\tflags?: ComponentFlags[];\n\tpermissions?: CommandPermissionValues;\n\texecute: (\n\t\tclient: TriviousClient,\n\t\tinteraction: ContextualComponentInteraction<Context>\n\t) => Promise<void>;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/components/components.types.ts"],"sourcesContent":["import { CommandPermissionValues, TriviousClient } from \"@typings\";\nimport { AnySelectMenuInteraction, ButtonInteraction, ModalSubmitInteraction } from \"discord.js\";\n\nexport type ComponentFlags = \"Cached\" | \"DeferReply\" | \"EphemeralReply\" | \"ExpectModal\";\nexport type ComponentInteraction =\n\t| AnySelectMenuInteraction\n\t| ButtonInteraction\n\t| ModalSubmitInteraction;\n\nexport enum ComponentContext {\n\tButton,\n\tSelectMenu,\n\tModal,\n}\n\ntype ContextualComponentInteraction<Context extends ComponentContext = ComponentContext> =\n\tContext extends ComponentContext.Button\n\t\t? ButtonInteraction\n\t\t: Context extends ComponentContext.SelectMenu\n\t\t\t? AnySelectMenuInteraction\n\t\t\t: Context extends ComponentContext.Modal\n\t\t\t\t? ModalSubmitInteraction\n\t\t\t\t: ComponentInteraction;\n\n/**\n * Trivious component\n * @param context The component context\n * @param identifier The unique identifier inside the custom id\n * @param flags The component flags\n * @param execute Component handler\n */\nexport interface Component<Context extends ComponentContext = ComponentContext> {\n\t/**\n\t * @deprecated Use context instead\n\t */\n\tcomponent?: Context;\n\tcontext: Context;\n\tidentifier: string;\n\tflags?: ComponentFlags[];\n\tpermissions?: CommandPermissionValues;\n\texecute: (\n\t\tclient: TriviousClient,\n\t\tinteraction: ContextualComponentInteraction<Context>\n\t) => Promise<void>;\n}\n"],"mappings":"AASO,IAAK,mBAAL,kBAAKA,sBAAL;AACN,EAAAA,oCAAA;AACA,EAAAA,oCAAA;AACA,EAAAA,oCAAA;AAHW,SAAAA;AAAA,GAAA;","names":["ComponentContext"]}
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-lYoNHt-m.js';
1
+ import { T as TriviousClient } from '../../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -1,16 +1,15 @@
1
- import { ComponentContext } from '../../shared/typings.js';
2
- import { TriviousError } from '../../utility/errors.js';
3
- import { importFile } from '../../utility/functions.js';
4
- import { existsSync, promises } from 'fs';
5
- import { join } from 'path';
6
-
1
+ import { ComponentContext } from "../../shared/typings.js";
2
+ import { TriviousError } from "../../utility/errors.js";
3
+ import { importFile } from "../../utility/functions.js";
4
+ import { existsSync, promises as fs } from "fs";
5
+ import { join } from "path";
7
6
  async function registerComponents(client, directory) {
8
7
  if (!existsSync(directory))
9
8
  throw new TriviousError(
10
9
  `Could not register components; passed directory '${directory} does not exist!'`,
11
10
  "Nonexistant directory passed"
12
11
  );
13
- const files = promises.glob(join(directory, "**/*.js"));
12
+ const files = fs.glob(join(directory, "**/*.js"));
14
13
  for await (const file of files) {
15
14
  const component = await importFile(file);
16
15
  if (!component || !("component" in component && "identifier" in component && "execute" in component))
@@ -22,7 +21,7 @@ async function registerComponents(client, directory) {
22
21
  client.stores.components.set(component.identifier, component);
23
22
  }
24
23
  }
25
-
26
- export { registerComponents as default };
27
- //# sourceMappingURL=registry.components.js.map
24
+ export {
25
+ registerComponents as default
26
+ };
28
27
  //# sourceMappingURL=registry.components.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/components/registry.components.ts"],"names":["fs"],"mappings":";;;;;;AAMA,eAAO,kBAAA,CAA0C,QAAwB,SAAA,EAAmB;AAC3F,EAAA,IAAI,CAAC,WAAW,SAAS,CAAA;AACxB,IAAA,MAAM,IAAI,aAAA;AAAA,MACT,oDAAoD,SAAS,CAAA,iBAAA,CAAA;AAAA,MAC7D;AAAA,KACD;AAED,EAAA,MAAM,QAAQA,QAAA,CAAG,IAAA,CAAK,IAAA,CAAK,SAAA,EAAW,SAAS,CAAC,CAAA;AAChD,EAAA,WAAA,MAAiB,QAAQ,KAAA,EAAO;AAC/B,IAAA,MAAM,SAAA,GAAY,MAAM,UAAA,CAAsB,IAAI,CAAA;AAClD,IAAA,IACC,CAAC,SAAA,IACD,EAAE,eAAe,SAAA,IAAa,YAAA,IAAgB,aAAa,SAAA,IAAa,SAAA,CAAA;AAExE,MAAA;AAED,IAAA,IAAI,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,GAAA,CAAI,UAAU,UAAU,CAAA;AACpD,MAAA,OAAA,CAAQ,IAAA;AAAA,QACP,oCAAoC,SAAA,CAAU,UAAU,uBAAuB,gBAAA,CAAiB,SAAA,CAAU,OAAO,CAAC,CAAA,yCAAA;AAAA,OACnH;AAED,IAAA,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,GAAA,CAAI,SAAA,CAAU,YAAY,SAAS,CAAA;AAAA,EAC7D;AACD","file":"registry.components.js","sourcesContent":["import { Component, ComponentContext, TriviousClient } from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport { importFile } from \"#utility/functions.js\";\nimport { existsSync, promises as fs } from \"fs\";\nimport { join } from \"path\";\n\nexport default async function registerComponents(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register components; passed directory '${directory} does not exist!'`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst component = await importFile<Component>(file);\n\t\tif (\n\t\t\t!component ||\n\t\t\t!(\"component\" in component && \"identifier\" in component && \"execute\" in component)\n\t\t)\n\t\t\tcontinue;\n\n\t\tif (client.stores.components.get(component.identifier))\n\t\t\tconsole.warn(\n\t\t\t\t`[Trivious] Component identifier '${component.identifier}' with the context '${ComponentContext[component.context]}' has a duplicate and has been overridden`\n\t\t\t);\n\n\t\tclient.stores.components.set(component.identifier, component);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/components/registry.components.ts"],"sourcesContent":["import { Component, ComponentContext, TriviousClient } from \"@typings\";\nimport { TriviousError } from \"@utility/errors.js\";\nimport { importFile } from \"@utility/functions.js\";\nimport { existsSync, promises as fs } from \"fs\";\nimport { join } from \"path\";\n\nexport default async function registerComponents(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register components; passed directory '${directory} does not exist!'`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst component = await importFile<Component>(file);\n\t\tif (\n\t\t\t!component ||\n\t\t\t!(\"component\" in component && \"identifier\" in component && \"execute\" in component)\n\t\t)\n\t\t\tcontinue;\n\n\t\tif (client.stores.components.get(component.identifier))\n\t\t\tconsole.warn(\n\t\t\t\t`[Trivious] Component identifier '${component.identifier}' with the context '${ComponentContext[component.context]}' has a duplicate and has been overridden`\n\t\t\t);\n\n\t\tclient.stores.components.set(component.identifier, component);\n\t}\n}\n"],"mappings":"AAAA,SAAoB,wBAAwC;AAC5D,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,YAAY,YAAY,UAAU;AAC3C,SAAS,YAAY;AAErB,eAAO,mBAA0C,QAAwB,WAAmB;AAC3F,MAAI,CAAC,WAAW,SAAS;AACxB,UAAM,IAAI;AAAA,MACT,oDAAoD,SAAS;AAAA,MAC7D;AAAA,IACD;AAED,QAAM,QAAQ,GAAG,KAAK,KAAK,WAAW,SAAS,CAAC;AAChD,mBAAiB,QAAQ,OAAO;AAC/B,UAAM,YAAY,MAAM,WAAsB,IAAI;AAClD,QACC,CAAC,aACD,EAAE,eAAe,aAAa,gBAAgB,aAAa,aAAa;AAExE;AAED,QAAI,OAAO,OAAO,WAAW,IAAI,UAAU,UAAU;AACpD,cAAQ;AAAA,QACP,oCAAoC,UAAU,UAAU,uBAAuB,iBAAiB,UAAU,OAAO,CAAC;AAAA,MACnH;AAED,WAAO,OAAO,WAAW,IAAI,UAAU,YAAY,SAAS;AAAA,EAC7D;AACD;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import '../client/client.types.js';
2
- import { e as ComponentContext } from '../../modules.types-lYoNHt-m.js';
2
+ import { g as ComponentContext } from '../../modules.types-STECtgbF.js';
3
3
  import '../permissions/permissions.types.js';
4
4
  import 'discord.js';
5
5
 
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=customid.types.js.map
3
1
  //# sourceMappingURL=customid.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"customid.types.js"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,7 +1,7 @@
1
1
  import { ComponentCustomId } from './customid.types.js';
2
2
  import '../client/client.types.js';
3
3
  import 'discord.js';
4
- import '../../modules.types-lYoNHt-m.js';
4
+ import '../../modules.types-STECtgbF.js';
5
5
  import '../permissions/permissions.types.js';
6
6
 
7
7
  declare const customId: {
@@ -1,5 +1,4 @@
1
- import { TriviousError } from '../../utility/errors.js';
2
-
1
+ import { TriviousError } from "../../utility/errors.js";
3
2
  const customId = {
4
3
  /**
5
4
  * Decode a customId into its parts
@@ -27,7 +26,7 @@ const customId = {
27
26
  }
28
27
  };
29
28
  var methods_customid_default = customId;
30
-
31
- export { methods_customid_default as default };
32
- //# sourceMappingURL=methods.customid.js.map
29
+ export {
30
+ methods_customid_default as default
31
+ };
33
32
  //# sourceMappingURL=methods.customid.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/customId/methods.customid.ts"],"names":["customId"],"mappings":";;AAGA,MAAM,QAAA,GAAW;AAAA;AAAA;AAAA;AAAA,EAIhB,MAAA,EAAQ,CAACA,SAAAA,KAAqB;AAC7B,IAAA,MAAM,CAAC,OAAA,EAAS,UAAA,EAAY,IAAI,CAAA,GAAIA,SAAAA,CAAS,MAAM,GAAG,CAAA;AAKtD,IAAA,MAAM,CAAC,IAAA,EAAM,GAAG,IAAI,CAAA,GAAI,IAAA,GACpB,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,GACf,CAAC,MAAA,EAAW,MAAS,CAAA;AAExB,IAAA,OAAO;AAAA,MACN,OAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA,KACD;AAAA,EACD,CAAA;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ,CAAC,OAAA,KAA+B;AACvC,IAAA,MAAM,EAAE,OAAA,EAAS,UAAA,EAAY,IAAA,EAAM,MAAK,GAAI,OAAA;AAC5C,IAAA,IAAIA,SAAAA,GAAW,CAAA,EAAG,OAAO,CAAA,CAAA,EAAI,UAAU,CAAA,CAAA;AAEvC,IAAA,IAAI,IAAA,EAAMA,SAAAA,IAAY,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAC9B,IAAA,IAAI,MAAMA,SAAAA,IAAY,IAAI,IAAA,CAAK,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAExC,IAAA,IAAIA,UAAS,MAAA,GAAS,GAAA,EAAK,MAAM,IAAI,cAAc,0CAA0C,CAAA;AAC7F,IAAA,OAAOA,SAAAA;AAAA,EACR;AACD,CAAA;AAEA,IAAO,wBAAA,GAAQ","file":"methods.customid.js","sourcesContent":["import { ComponentContext, ComponentCustomId, ComponentTag } from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\n\nconst customId = {\n\t/**\n\t * Decode a customId into its parts\n\t */\n\tdecode: (customId: string) => {\n\t\tconst [context, identifier, info] = customId.split(\":\") as [\n\t\t\tComponentContext,\n\t\t\tstring,\n\t\t\tstring | undefined,\n\t\t];\n\t\tconst [data, ...tags] = info\n\t\t\t? (info.split(\".\") as [string | undefined, ...ComponentTag[]])\n\t\t\t: [undefined, undefined];\n\n\t\treturn {\n\t\t\tcontext,\n\t\t\tidentifier,\n\t\t\tdata,\n\t\t\ttags,\n\t\t} as ComponentCustomId;\n\t},\n\t/**\n\t * Encode a customId\n\t */\n\tencode: (options: ComponentCustomId) => {\n\t\tconst { context, identifier, data, tags } = options;\n\t\tlet customId = `${context}:${identifier}`;\n\n\t\tif (data) customId += `:${data}`;\n\t\tif (tags) customId += `.${tags.join(\".\")}`;\n\n\t\tif (customId.length > 100) throw new TriviousError(\"Encoded customId exceeds 100 characters.\");\n\t\treturn customId;\n\t},\n} as const;\n\nexport default customId;\n"]}
1
+ {"version":3,"sources":["../../../src/features/customId/methods.customid.ts"],"sourcesContent":["import { ComponentContext, ComponentCustomId, ComponentTag } from \"@typings\";\nimport { TriviousError } from \"@utility/errors.js\";\n\nconst customId = {\n\t/**\n\t * Decode a customId into its parts\n\t */\n\tdecode: (customId: string) => {\n\t\tconst [context, identifier, info] = customId.split(\":\") as [\n\t\t\tComponentContext,\n\t\t\tstring,\n\t\t\tstring | undefined,\n\t\t];\n\t\tconst [data, ...tags] = info\n\t\t\t? (info.split(\".\") as [string | undefined, ...ComponentTag[]])\n\t\t\t: [undefined, undefined];\n\n\t\treturn {\n\t\t\tcontext,\n\t\t\tidentifier,\n\t\t\tdata,\n\t\t\ttags,\n\t\t} as ComponentCustomId;\n\t},\n\t/**\n\t * Encode a customId\n\t */\n\tencode: (options: ComponentCustomId) => {\n\t\tconst { context, identifier, data, tags } = options;\n\t\tlet customId = `${context}:${identifier}`;\n\n\t\tif (data) customId += `:${data}`;\n\t\tif (tags) customId += `.${tags.join(\".\")}`;\n\n\t\tif (customId.length > 100) throw new TriviousError(\"Encoded customId exceeds 100 characters.\");\n\t\treturn customId;\n\t},\n} as const;\n\nexport default customId;\n"],"mappings":"AACA,SAAS,qBAAqB;AAE9B,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAIhB,QAAQ,CAACA,cAAqB;AAC7B,UAAM,CAAC,SAAS,YAAY,IAAI,IAAIA,UAAS,MAAM,GAAG;AAKtD,UAAM,CAAC,MAAM,GAAG,IAAI,IAAI,OACpB,KAAK,MAAM,GAAG,IACf,CAAC,QAAW,MAAS;AAExB,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAAA;AAAA;AAAA;AAAA,EAIA,QAAQ,CAAC,YAA+B;AACvC,UAAM,EAAE,SAAS,YAAY,MAAM,KAAK,IAAI;AAC5C,QAAIA,YAAW,GAAG,OAAO,IAAI,UAAU;AAEvC,QAAI,KAAM,CAAAA,aAAY,IAAI,IAAI;AAC9B,QAAI,KAAM,CAAAA,aAAY,IAAI,KAAK,KAAK,GAAG,CAAC;AAExC,QAAIA,UAAS,SAAS,IAAK,OAAM,IAAI,cAAc,0CAA0C;AAC7F,WAAOA;AAAA,EACR;AACD;AAEA,IAAO,2BAAQ;","names":["customId"]}
@@ -1,4 +1,4 @@
1
- import { E as Event } from '../../modules.types-lYoNHt-m.js';
1
+ import { E as Event } from '../../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -7,7 +7,8 @@ function createOnceEvent(data) {
7
7
  ...data
8
8
  };
9
9
  }
10
-
11
- export { createEvent, createOnceEvent };
12
- //# sourceMappingURL=builders.events.js.map
10
+ export {
11
+ createEvent,
12
+ createOnceEvent
13
+ };
13
14
  //# sourceMappingURL=builders.events.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/events/builders.events.ts"],"names":[],"mappings":"AAOO,SAAS,YAAY,IAAA,EAAoB;AAC/C,EAAA,OAAO,IAAA;AACR;AAOO,SAAS,gBAAgB,IAAA,EAAkC;AACjE,EAAA,OAAO;AAAA,IACN,IAAA,EAAM,IAAA;AAAA,IACN,GAAG;AAAA,GACJ;AACD","file":"builders.events.js","sourcesContent":["import { Event } from \"#typings\";\n\n/**\n * Create an event handler\n * @param data Event data\n * @returns Event\n */\nexport function createEvent(data: Event): Event {\n\treturn data;\n}\n\n/**\n * Create an event handler that runs once\n * @param data Event data\n * @returns Event\n */\nexport function createOnceEvent(data: Omit<Event, \"once\">): Event {\n\treturn {\n\t\tonce: true,\n\t\t...data,\n\t} satisfies Event;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/events/builders.events.ts"],"sourcesContent":["import { Event } from \"@typings\";\n\n/**\n * Create an event handler\n * @param data Event data\n * @returns Event\n */\nexport function createEvent(data: Event): Event {\n\treturn data;\n}\n\n/**\n * Create an event handler that runs once\n * @param data Event data\n * @returns Event\n */\nexport function createOnceEvent(data: Omit<Event, \"once\">): Event {\n\treturn {\n\t\tonce: true,\n\t\t...data,\n\t} satisfies Event;\n}\n"],"mappings":"AAOO,SAAS,YAAY,MAAoB;AAC/C,SAAO;AACR;AAOO,SAAS,gBAAgB,MAAkC;AACjE,SAAO;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,EACJ;AACD;","names":[]}
@@ -1,4 +1,4 @@
1
1
  import 'discord.js';
2
- export { E as Event } from '../../modules.types-lYoNHt-m.js';
2
+ export { E as Event } from '../../modules.types-STECtgbF.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=events.types.js.map
3
1
  //# sourceMappingURL=events.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"events.types.js"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../../modules.types-lYoNHt-m.js';
1
+ import { T as TriviousClient } from '../../../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../../client/client.types.js';
4
4
  import '../../permissions/permissions.types.js';
@@ -5,7 +5,7 @@ var clientReady_default = {
5
5
  console.log(`Successfully logged into ${client.user?.username}`);
6
6
  }
7
7
  };
8
-
9
- export { clientReady_default as default };
10
- //# sourceMappingURL=clientReady.js.map
8
+ export {
9
+ clientReady_default as default
10
+ };
11
11
  //# sourceMappingURL=clientReady.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/features/events/presets/clientReady.ts"],"names":[],"mappings":"AAEA,IAAO,mBAAA,GAAQ;AAAA,EACd,IAAA,EAAM,aAAA;AAAA,EACN,IAAA,EAAM,IAAA;AAAA,EACN,MAAM,QAAQ,MAAA,EAAQ;AACrB,IAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,yBAAA,EAA4B,MAAA,CAAO,IAAA,EAAM,QAAQ,CAAA,CAAE,CAAA;AAAA,EAChE;AACD","file":"clientReady.js","sourcesContent":["import { Event } from \"#typings\";\n\nexport default {\n\tname: \"clientReady\",\n\tonce: true,\n\tasync execute(client) {\n\t\tconsole.log(`Successfully logged into ${client.user?.username}`);\n\t},\n} satisfies Event<\"clientReady\">;\n"]}
1
+ {"version":3,"sources":["../../../../src/features/events/presets/clientReady.ts"],"sourcesContent":["import { Event } from \"@typings\";\n\nexport default {\n\tname: \"clientReady\",\n\tonce: true,\n\tasync execute(client) {\n\t\tconsole.log(`Successfully logged into ${client.user?.username}`);\n\t},\n} satisfies Event<\"clientReady\">;\n"],"mappings":"AAEA,IAAO,sBAAQ;AAAA,EACd,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM,QAAQ,QAAQ;AACrB,YAAQ,IAAI,4BAA4B,OAAO,MAAM,QAAQ,EAAE;AAAA,EAChE;AACD;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import * as discord_js from 'discord.js';
2
- import { T as TriviousClient } from '../../../modules.types-lYoNHt-m.js';
2
+ import { T as TriviousClient } from '../../../modules.types-STECtgbF.js';
3
3
  import '../../client/client.types.js';
4
4
  import '../../permissions/permissions.types.js';
5
5
 
@@ -1,9 +1,14 @@
1
- import { ComponentContext } from '../../../shared/typings.js';
2
- import { ApplicationCommandType, ButtonInteraction, ModalSubmitInteraction } from 'discord.js';
3
- import { interactionReply, handleSlashCommand } from '../../../features/commands/methods.commands.js';
4
- import customId from '../../../features/customId/methods.customid.js';
5
- import { canMemberRunCommand } from '../../../features/permissions/methods.permissions.js';
6
-
1
+ import { handleSlashCommand, interactionReply } from "../../commands/methods.commands.js";
2
+ import customId from "../../customId/methods.customid.js";
3
+ import { canMemberRunCommand } from "../../permissions/methods.permissions.js";
4
+ import {
5
+ ComponentContext
6
+ } from "../../../shared/typings.js";
7
+ import {
8
+ ApplicationCommandType,
9
+ ButtonInteraction,
10
+ ModalSubmitInteraction
11
+ } from "discord.js";
7
12
  function validateMemberPermissionsForSubcommand(client, command, interaction) {
8
13
  if (!("subcommands" in command)) return [false, "Cannot validate subcommand permissions"];
9
14
  if (!interaction.isChatInputCommand()) return [false, "Cannot validate subcommand permissions"];
@@ -88,7 +93,7 @@ var interactionCreate_default = {
88
93
  }
89
94
  }
90
95
  };
91
-
92
- export { interactionCreate_default as default };
93
- //# sourceMappingURL=interactionCreate.js.map
96
+ export {
97
+ interactionCreate_default as default
98
+ };
94
99
  //# sourceMappingURL=interactionCreate.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/features/events/presets/interactionCreate.ts"],"names":["subcommand"],"mappings":";;;;;;AAuBA,SAAS,sCAAA,CACR,MAAA,EACA,OAAA,EACA,WAAA,EAIoB;AACpB,EAAA,IAAI,EAAE,aAAA,IAAiB,OAAA,CAAA,EAAU,OAAO,CAAC,OAAO,wCAAwC,CAAA;AACxF,EAAA,IAAI,CAAC,WAAA,CAAY,kBA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AAc,EAAG;AAC3E,MAAA,MAAM,EAAE,SAAS,UAAA,EAAY,IAAA,KAAS,QAAA,CAAS,MAAA,CAAO,YAAY,QAAQ,CAAA;AAC1E,MAAA,IAAI,OAAA,KAAY,gBAAA,CAAiB,MAAA,IAAU,EAAE,WAAA,YAAuB,iBAAA,CAAA;AACnE,QAAA;AACD,MAAA,IAAI,OAAA,KAAY,gBAAA,CAAiB,KAAA,IAAS,EAAE,WAAA,YAAuB,sBAAA,CAAA;AAClE,QAAA;AACD,MAAA,IAAI,IAAA,IAAQ,IAAA,CAAK,QAAA,CAAS,SAAS,CAAA,EAAG;AAEtC,MAAA,MAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,IAAI,UAAU,CAAA;AAEzD,MAAA,IAAI,CAAC,SAAA,EAAW;AACf,QAAA,MAAM,gBAAA,CAAiB;AAAA,UACtB,WAAA;AAAA,UACA,YAAA,EAAc,EAAE,OAAA,EAAS,4DAAA,EAA6D;AAAA,UACtF,KAAA,EAAO,CAAC,gBAAgB;AAAA,SACxB,CAAA;AACD,QAAA;AAAA,MACD;AAEA,MAAA,MAAM,aAAA,GAAgB,mBAAA;AAAA,QACrB,MAAA;AAAA,QACA,SAAA;AAAA,QACA,WAAA,CAAY;AAAA,OACb;AACA,MAAA,IAAI,CAAC,aAAA,EAAe;AACnB,QAAA,MAAM,gBAAA,CAAiB;AAAA,UACtB,WAAA;AAAA,UACA,YAAA,EAAc,EAAE,OAAA,EAAS,kDAAA,EAAmD;AAAA,UAC5E,KAAA,EAAO,CAAC,gBAAgB;AAAA,SACxB,CAAA;AACD,QAAA;AAAA,MACD;AACA,MAAA,MAAM,SAAA,CAAU,OAAA,CAAQ,MAAA,EAAQ,WAAW,CAAA;AAAA,IAC5C;AAAA,EACD;AACD","file":"interactionCreate.js","sourcesContent":["import {\n\tComponentContext,\n\tSlashCommandData,\n\tTriviousClient,\n\ttype ContextCommandData,\n\ttype Event,\n} from \"#typings\";\nimport {\n\tApplicationCommandType,\n\tButtonInteraction,\n\tChatInputCommandInteraction,\n\tGuildMember,\n\tMessageContextMenuCommandInteraction,\n\tModalSubmitInteraction,\n\tUserContextMenuCommandInteraction,\n} from \"discord.js\";\nimport { handleSlashCommand, interactionReply } from \"src/features/commands/methods.commands.js\";\nimport customId from \"src/features/customId/methods.customid.js\";\nimport { canMemberRunCommand } from \"src/features/permissions/methods.permissions.js\";\n\n/**\n * Check if the command is a subcommand and validate whether the member can run the command based on subcommand permissions\n */\nfunction validateMemberPermissionsForSubcommand(\n\tclient: TriviousClient,\n\tcommand: SlashCommandData | ContextCommandData,\n\tinteraction:\n\t\t| ChatInputCommandInteraction\n\t\t| MessageContextMenuCommandInteraction\n\t\t| UserContextMenuCommandInteraction\n): [boolean, string] {\n\tif (!(\"subcommands\" in command)) return [false, \"Cannot validate subcommand permissions\"];\n\tif (!interaction.isChatInputCommand()) return [false, \"Cannot validate subcommand permissions\"];\n\n\tconst { options } = interaction;\n\n\tconst subcommandName = options.getSubcommand(false);\n\tconst groupName = options.getSubcommandGroup(false);\n\tif (!subcommandName) return [false, \"Cannot validate subcommand permissions\"];\n\n\tif (groupName) {\n\t\tconst group = command.subcommandGroups?.get(groupName);\n\t\tif (!group) return [false, \"Cannot validate subcommand permissions\"];\n\n\t\tconst subcommand = group.subcommands.get(subcommandName);\n\t\tif (!subcommand) return [false, \"Cannot validate subcommand permissions\"];\n\n\t\treturn canMemberRunCommand(client, subcommand, interaction.member as GuildMember);\n\t}\n\n\tconst subcommand = command.subcommands?.get(subcommandName);\n\tif (!subcommand) return [false, \"Cannot validate subcommand permissions\"];\n\n\treturn canMemberRunCommand(client, subcommand, interaction.member as GuildMember);\n}\n\nexport default {\n\tname: \"interactionCreate\",\n\tasync execute(client, interaction) {\n\t\tif (interaction.isChatInputCommand() || interaction.isContextMenuCommand()) {\n\t\t\tconst { commandName } = interaction;\n\n\t\t\tconst storeToCheck = interaction.isChatInputCommand()\n\t\t\t\t? client.stores.commands.chatInput\n\t\t\t\t: client.stores.commands.context;\n\t\t\tconst command = storeToCheck.get(commandName);\n\n\t\t\tif (!command) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst subcommandPerms = validateMemberPermissionsForSubcommand(client, command, interaction);\n\t\t\tconst commandPerms = canMemberRunCommand(client, command, interaction.member as GuildMember);\n\t\t\tconst hasPermission = subcommandPerms[0] && commandPerms[0] ? true : false;\n\t\t\tif (!hasPermission) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: {\n\t\t\t\t\t\tcontent: `You do not have permission to run this command`,\n\t\t\t\t\t},\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tcommand.commandType === ApplicationCommandType.ChatInput &&\n\t\t\t\tinteraction.isChatInputCommand()\n\t\t\t) {\n\t\t\t\tawait handleSlashCommand(client, command, interaction);\n\t\t\t} else {\n\t\t\t\tawait (command as ContextCommandData).execute(client, interaction as never);\n\t\t\t}\n\t\t} else if (interaction.isMessageComponent() || interaction.isModalSubmit()) {\n\t\t\tconst { context, identifier, tags } = customId.decode(interaction.customId);\n\t\t\tif (context === ComponentContext.Button && !(interaction instanceof ButtonInteraction))\n\t\t\t\treturn;\n\t\t\tif (context === ComponentContext.Modal && !(interaction instanceof ModalSubmitInteraction))\n\t\t\t\treturn;\n\t\t\tif (tags && tags.includes(\"awaited\")) return;\n\n\t\t\tconst component = client.stores.components.get(identifier);\n\n\t\t\tif (!component) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst hasPermission = canMemberRunCommand(\n\t\t\t\tclient,\n\t\t\t\tcomponent,\n\t\t\t\tinteraction.member as GuildMember\n\t\t\t);\n\t\t\tif (!hasPermission) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"You do not have permission to use this component\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait component.execute(client, interaction);\n\t\t}\n\t},\n} satisfies Event<\"interactionCreate\">;\n"]}
1
+ {"version":3,"sources":["../../../../src/features/events/presets/interactionCreate.ts"],"sourcesContent":["import { handleSlashCommand, interactionReply } from \"@feature/commands/methods.commands.js\";\nimport customId from \"@feature/customId/methods.customid.js\";\nimport { canMemberRunCommand } from \"@feature/permissions/methods.permissions.js\";\nimport {\n\tComponentContext,\n\tSlashCommandData,\n\tTriviousClient,\n\ttype ContextCommandData,\n\ttype Event,\n} from \"@typings\";\nimport {\n\tApplicationCommandType,\n\tButtonInteraction,\n\tChatInputCommandInteraction,\n\tGuildMember,\n\tMessageContextMenuCommandInteraction,\n\tModalSubmitInteraction,\n\tUserContextMenuCommandInteraction,\n} from \"discord.js\";\n\n/**\n * Check if the command is a subcommand and validate whether the member can run the command based on subcommand permissions\n */\nfunction validateMemberPermissionsForSubcommand(\n\tclient: TriviousClient,\n\tcommand: SlashCommandData | ContextCommandData,\n\tinteraction:\n\t\t| ChatInputCommandInteraction\n\t\t| MessageContextMenuCommandInteraction\n\t\t| UserContextMenuCommandInteraction\n): [boolean, string] {\n\tif (!(\"subcommands\" in command)) return [false, \"Cannot validate subcommand permissions\"];\n\tif (!interaction.isChatInputCommand()) return [false, \"Cannot validate subcommand permissions\"];\n\n\tconst { options } = interaction;\n\n\tconst subcommandName = options.getSubcommand(false);\n\tconst groupName = options.getSubcommandGroup(false);\n\tif (!subcommandName) return [false, \"Cannot validate subcommand permissions\"];\n\n\tif (groupName) {\n\t\tconst group = command.subcommandGroups?.get(groupName);\n\t\tif (!group) return [false, \"Cannot validate subcommand permissions\"];\n\n\t\tconst subcommand = group.subcommands.get(subcommandName);\n\t\tif (!subcommand) return [false, \"Cannot validate subcommand permissions\"];\n\n\t\treturn canMemberRunCommand(client, subcommand, interaction.member as GuildMember);\n\t}\n\n\tconst subcommand = command.subcommands?.get(subcommandName);\n\tif (!subcommand) return [false, \"Cannot validate subcommand permissions\"];\n\n\treturn canMemberRunCommand(client, subcommand, interaction.member as GuildMember);\n}\n\nexport default {\n\tname: \"interactionCreate\",\n\tasync execute(client, interaction) {\n\t\tif (interaction.isChatInputCommand() || interaction.isContextMenuCommand()) {\n\t\t\tconst { commandName } = interaction;\n\n\t\t\tconst storeToCheck = interaction.isChatInputCommand()\n\t\t\t\t? client.stores.commands.chatInput\n\t\t\t\t: client.stores.commands.context;\n\t\t\tconst command = storeToCheck.get(commandName);\n\n\t\t\tif (!command) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst subcommandPerms = validateMemberPermissionsForSubcommand(client, command, interaction);\n\t\t\tconst commandPerms = canMemberRunCommand(client, command, interaction.member as GuildMember);\n\t\t\tconst hasPermission = subcommandPerms[0] && commandPerms[0] ? true : false;\n\t\t\tif (!hasPermission) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: {\n\t\t\t\t\t\tcontent: `You do not have permission to run this command`,\n\t\t\t\t\t},\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tcommand.commandType === ApplicationCommandType.ChatInput &&\n\t\t\t\tinteraction.isChatInputCommand()\n\t\t\t) {\n\t\t\t\tawait handleSlashCommand(client, command, interaction);\n\t\t\t} else {\n\t\t\t\tawait (command as ContextCommandData).execute(client, interaction as never);\n\t\t\t}\n\t\t} else if (interaction.isMessageComponent() || interaction.isModalSubmit()) {\n\t\t\tconst { context, identifier, tags } = customId.decode(interaction.customId);\n\t\t\tif (context === ComponentContext.Button && !(interaction instanceof ButtonInteraction))\n\t\t\t\treturn;\n\t\t\tif (context === ComponentContext.Modal && !(interaction instanceof ModalSubmitInteraction))\n\t\t\t\treturn;\n\t\t\tif (tags && tags.includes(\"awaited\")) return;\n\n\t\t\tconst component = client.stores.components.get(identifier);\n\n\t\t\tif (!component) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst hasPermission = canMemberRunCommand(\n\t\t\t\tclient,\n\t\t\t\tcomponent,\n\t\t\t\tinteraction.member as GuildMember\n\t\t\t);\n\t\t\tif (!hasPermission) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"You do not have permission to use this component\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait component.execute(client, interaction);\n\t\t}\n\t},\n} satisfies Event<\"interactionCreate\">;\n"],"mappings":"AAAA,SAAS,oBAAoB,wBAAwB;AACrD,OAAO,cAAc;AACrB,SAAS,2BAA2B;AACpC;AAAA,EACC;AAAA,OAKM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EAIA;AAAA,OAEM;AAKP,SAAS,uCACR,QACA,SACA,aAIoB;AACpB,MAAI,EAAE,iBAAiB,SAAU,QAAO,CAAC,OAAO,wCAAwC;AACxF,MAAI,CAAC,YAAY,m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,UAAI,CAAC,eAAe;AACnB,cAAM,iBAAiB;AAAA,UACtB;AAAA,UACA,cAAc;AAAA,YACb,SAAS;AAAA,UACV;AAAA,UACA,OAAO,CAAC,gBAAgB;AAAA,QACzB,CAAC;AACD;AAAA,MACD;AAEA,UACC,QAAQ,gBAAgB,uBAAuB,aAC/C,YAAY,mBAAmB,GAC9B;AACD,cAAM,mBAAmB,QAAQ,SAAS,WAAW;AAAA,MACtD,OAAO;AACN,cAAO,QAA+B,QAAQ,QAAQ,WAAoB;AAAA,MAC3E;AAAA,IACD,WAAW,YAAY,mBAAmB,KAAK,YAAY,cAAc,GAAG;AAC3E,YAAM,EAAE,SAAS,YAAY,KAAK,IAAI,SAAS,OAAO,YAAY,QAAQ;AAC1E,UAAI,YAAY,iBAAiB,UAAU,EAAE,uBAAuB;AACnE;AACD,UAAI,YAAY,iBAAiB,SAAS,EAAE,uBAAuB;AAClE;AACD,UAAI,QAAQ,KAAK,SAAS,SAAS,EAAG;AAEtC,YAAM,YAAY,OAAO,OAAO,WAAW,IAAI,UAAU;AAEzD,UAAI,CAAC,WAAW;AACf,cAAM,iBAAiB;AAAA,UACtB;AAAA,UACA,cAAc,EAAE,SAAS,6DAA6D;AAAA,UACtF,OAAO,CAAC,gBAAgB;AAAA,QACzB,CAAC;AACD;AAAA,MACD;AAEA,YAAM,gBAAgB;AAAA,QACrB;AAAA,QACA;AAAA,QACA,YAAY;AAAA,MACb;AACA,UAAI,CAAC,eAAe;AACnB,cAAM,iBAAiB;AAAA,UACtB;AAAA,UACA,cAAc,EAAE,SAAS,mDAAmD;AAAA,UAC5E,OAAO,CAAC,gBAAgB;AAAA,QACzB,CAAC;AACD;AAAA,MACD;AACA,YAAM,UAAU,QAAQ,QAAQ,WAAW;AAAA,IAC5C;AAAA,EACD;AACD;","names":["subcommand"]}
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-lYoNHt-m.js';
1
+ import { T as TriviousClient } from '../../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -1,12 +1,11 @@
1
- import { TriviousError } from '../../utility/errors.js';
2
- import { importFile } from '../../utility/functions.js';
3
- import { existsSync, promises } from 'fs';
4
- import path, { join } from 'path';
5
-
1
+ import { TriviousError } from "../../utility/errors.js";
2
+ import { importFile } from "../../utility/functions.js";
3
+ import { existsSync, promises as fs } from "fs";
4
+ import path, { join } from "path";
6
5
  async function loadPresetEvents(client) {
7
6
  const directory = path.resolve(import.meta.dirname, "presets");
8
7
  if (!existsSync(directory)) return;
9
- const files = promises.glob(join(directory, "./*.js"));
8
+ const files = fs.glob(join(directory, "./*.js"));
10
9
  for await (const file of files) {
11
10
  const event = await parseEvent(file);
12
11
  if (!event) continue;
@@ -32,7 +31,7 @@ async function registerEvents(client, directory) {
32
31
  "Nonexistant directory passed"
33
32
  );
34
33
  await loadPresetEvents(client);
35
- const files = promises.glob(join(directory, "**/*.js"));
34
+ const files = fs.glob(join(directory, "**/*.js"));
36
35
  for await (const file of files) {
37
36
  const event = await parseEvent(file);
38
37
  if (!event) continue;
@@ -41,7 +40,8 @@ async function registerEvents(client, directory) {
41
40
  client.stores.events.set(event.name, event);
42
41
  }
43
42
  }
44
-
45
- export { bindEvents, registerEvents as default };
46
- //# sourceMappingURL=registry.events.js.map
43
+ export {
44
+ bindEvents,
45
+ registerEvents as default
46
+ };
47
47
  //# sourceMappingURL=registry.events.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/events/registry.events.ts"],"names":["fs"],"mappings":";;;;;AAOA,eAAe,iBAAiB,MAAA,EAAwB;AACvD,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,OAAA,CAAQ,MAAA,CAAA,IAAA,CAAY,SAAS,SAAS,CAAA;AAC7D,EAAA,IAAI,CAAC,UAAA,CAAW,SAAS,CAAA,EAAG;AAE5B,EAAA,MAAM,QAAQA,QAAA,CAAG,IAAA,CAAK,IAAA,CAAK,SAA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,MAAiB,QAAQ,KAAA,EAAO;AAC/B,IAAA,MAAM,KAAA,GAAQ,MAAM,UAAA,CAAW,IAAI,CAAA;AACnC,IAAA,IAAI,CAAC,KAAA,EAAO;AAEZ,IAAA,IAAI,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,GAAA,CAAI,MAAM,IAAI,CAAA;AACtC,MAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,kBAAA,EAAqB,KAAA,CAAM,IAAI,CAAA,yCAAA,CAA2C,CAAA;AAExF,IAAA,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,GAAA,CAAI,KAAA,CAAM,MAAM,KAAK,CAAA;AAAA,EAC3C;AACD","file":"registry.events.js","sourcesContent":["import { Event, TriviousClient } from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport { importFile } from \"#utility/functions.js\";\nimport { ClientEvents } from \"discord.js\";\nimport { existsSync, promises as fs } from \"fs\";\nimport path, { join } from \"path\";\n\nasync function loadPresetEvents(client: TriviousClient) {\n\tconst directory = path.resolve(import.meta.dirname, \"presets\");\n\tif (!existsSync(directory)) return;\n\n\tconst files = fs.glob(join(directory, \"./*.js\"));\n\tfor await (const file of files) {\n\t\tconst event = await parseEvent(file);\n\t\tif (!event) continue;\n\n\t\tclient.stores.events.set(event.name, event);\n\t}\n}\n\nasync function parseEvent(file: string) {\n\tconst event = await importFile<Event>(file);\n\tif (!event || !(\"name\" in event && \"execute\" in event)) return null;\n\n\treturn event;\n}\n\nexport async function bindEvents(client: TriviousClient) {\n\tfor (const event of client.stores.events.values()) {\n\t\tconst handler = (...args: ClientEvents[typeof event.name]) =>\n\t\t\tvoid event.execute(client, ...args);\n\n\t\tif (event.once) client.once(event.name, handler);\n\t\telse client.on(event.name, handler);\n\t}\n}\n\nexport default async function registerEvents(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register events; passed directory '${directory}' does not exist!`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tawait loadPresetEvents(client);\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst event = await parseEvent(file);\n\t\tif (!event) continue;\n\n\t\tif (client.stores.events.get(event.name))\n\t\t\tconsole.warn(`[Trivious] Event '${event.name}' has a duplicate and has been overridden`);\n\n\t\tclient.stores.events.set(event.name, event);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/events/registry.events.ts"],"sourcesContent":["import { Event, TriviousClient } from \"@typings\";\nimport { TriviousError } from \"@utility/errors.js\";\nimport { importFile } from \"@utility/functions.js\";\nimport { ClientEvents } from \"discord.js\";\nimport { existsSync, promises as fs } from \"fs\";\nimport path, { join } from \"path\";\n\nasync function loadPresetEvents(client: TriviousClient) {\n\tconst directory = path.resolve(import.meta.dirname, \"presets\");\n\tif (!existsSync(directory)) return;\n\n\tconst files = fs.glob(join(directory, \"./*.js\"));\n\tfor await (const file of files) {\n\t\tconst event = await parseEvent(file);\n\t\tif (!event) continue;\n\n\t\tclient.stores.events.set(event.name, event);\n\t}\n}\n\nasync function parseEvent(file: string) {\n\tconst event = await importFile<Event>(file);\n\tif (!event || !(\"name\" in event && \"execute\" in event)) return null;\n\n\treturn event;\n}\n\nexport async function bindEvents(client: TriviousClient) {\n\tfor (const event of client.stores.events.values()) {\n\t\tconst handler = (...args: ClientEvents[typeof event.name]) =>\n\t\t\tvoid event.execute(client, ...args);\n\n\t\tif (event.once) client.once(event.name, handler);\n\t\telse client.on(event.name, handler);\n\t}\n}\n\nexport default async function registerEvents(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register events; passed directory '${directory}' does not exist!`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tawait loadPresetEvents(client);\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst event = await parseEvent(file);\n\t\tif (!event) continue;\n\n\t\tif (client.stores.events.get(event.name))\n\t\t\tconsole.warn(`[Trivious] Event '${event.name}' has a duplicate and has been overridden`);\n\n\t\tclient.stores.events.set(event.name, event);\n\t}\n}\n"],"mappings":"AACA,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAE3B,SAAS,YAAY,YAAY,UAAU;AAC3C,OAAO,QAAQ,YAAY;AAE3B,eAAe,iBAAiB,QAAwB;AACvD,QAAM,YAAY,KAAK,QAAQ,YAAY,SAAS,SAAS;AAC7D,MAAI,CAAC,WAAW,SAAS,EAAG;AAE5B,QAAM,QAAQ,GAAG,KAAK,KAAK,WAAW,QAAQ,CAAC;AAC/C,mBAAiB,QAAQ,OAAO;AAC/B,UAAM,QAAQ,MAAM,WAAW,IAAI;AACnC,QAAI,CAAC,MAAO;AAEZ,WAAO,OAAO,OAAO,IAAI,MAAM,MAAM,KAAK;AAAA,EAC3C;AACD;AAEA,eAAe,WAAW,MAAc;AACvC,QAAM,QAAQ,MAAM,WAAkB,IAAI;AAC1C,MAAI,CAAC,SAAS,EAAE,UAAU,SAAS,aAAa,OAAQ,QAAO;AAE/D,SAAO;AACR;AAEA,eAAsB,WAAW,QAAwB;AACxD,aAAW,SAAS,OAAO,OAAO,OAAO,OAAO,GAAG;AAClD,UAAM,UAAU,IAAI,SACnB,KAAK,MAAM,QAAQ,QAAQ,GAAG,IAAI;AAEnC,QAAI,MAAM,KAAM,QAAO,KAAK,MAAM,MAAM,OAAO;AAAA,QAC1C,QAAO,GAAG,MAAM,MAAM,OAAO;AAAA,EACnC;AACD;AAEA,eAAO,eAAsC,QAAwB,WAAmB;AACvF,MAAI,CAAC,WAAW,SAAS;AACxB,UAAM,IAAI;AAAA,MACT,gDAAgD,SAAS;AAAA,MACzD;AAAA,IACD;AAED,QAAM,iBAAiB,MAAM;AAE7B,QAAM,QAAQ,GAAG,KAAK,KAAK,WAAW,SAAS,CAAC;AAChD,mBAAiB,QAAQ,OAAO;AAC/B,UAAM,QAAQ,MAAM,WAAW,IAAI;AACnC,QAAI,CAAC,MAAO;AAEZ,QAAI,OAAO,OAAO,OAAO,IAAI,MAAM,IAAI;AACtC,cAAQ,KAAK,qBAAqB,MAAM,IAAI,2CAA2C;AAExF,WAAO,OAAO,OAAO,IAAI,MAAM,MAAM,KAAK;AAAA,EAC3C;AACD;","names":[]}
@@ -1,4 +1,4 @@
1
- import { M as Module } from '../../modules.types-lYoNHt-m.js';
1
+ import { M as Module } from '../../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -1,7 +1,7 @@
1
1
  function createModule(data) {
2
2
  return data;
3
3
  }
4
-
5
- export { createModule };
6
- //# sourceMappingURL=builders.modules.js.map
4
+ export {
5
+ createModule
6
+ };
7
7
  //# sourceMappingURL=builders.modules.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/modules/builders.modules.ts"],"names":[],"mappings":"AAOO,SAAS,aAAa,IAAA,EAAc;AAC1C,EAAA,OAAO,IAAA;AACR","file":"builders.modules.js","sourcesContent":["import { Module } from \"#typings\";\n\n/**\n * Create a module\n * @param data Module data\n * @returns Module\n */\nexport function createModule(data: Module) {\n\treturn data;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/modules/builders.modules.ts"],"sourcesContent":["import { Module } from \"@typings\";\n\n/**\n * Create a module\n * @param data Module data\n * @returns Module\n */\nexport function createModule(data: Module) {\n\treturn data;\n}\n"],"mappings":"AAOO,SAAS,aAAa,MAAc;AAC1C,SAAO;AACR;","names":[]}
@@ -1,4 +1,4 @@
1
1
  import 'discord.js';
2
- export { M as Module } from '../../modules.types-lYoNHt-m.js';
2
+ export { M as Module } from '../../modules.types-STECtgbF.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=modules.types.js.map
3
1
  //# sourceMappingURL=modules.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"modules.types.js"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-lYoNHt-m.js';
1
+ import { T as TriviousClient } from '../../modules.types-STECtgbF.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
  import '../permissions/permissions.types.js';
@@ -1,8 +1,7 @@
1
- import { TriviousError } from '../../utility/errors.js';
2
- import { importFile } from '../../utility/functions.js';
3
- import { existsSync, promises } from 'fs';
4
- import { join } from 'path';
5
-
1
+ import { TriviousError } from "../../utility/errors.js";
2
+ import { importFile } from "../../utility/functions.js";
3
+ import { existsSync, promises as fs } from "fs";
4
+ import { join } from "path";
6
5
  async function bindModules(client) {
7
6
  for (const moduleData of client.stores.modules.values()) {
8
7
  for (const [name, handler] of Object.entries(moduleData.events)) {
@@ -17,7 +16,7 @@ async function registerModules(client, directory) {
17
16
  `Could not register modules; passed directory '${directory}' does not exist!`,
18
17
  "Nonexistant directory passed"
19
18
  );
20
- const files = promises.glob(join(directory, "**/*.js"));
19
+ const files = fs.glob(join(directory, "**/*.js"));
21
20
  for await (const file of files) {
22
21
  const moduleData = await importFile(file);
23
22
  if (!moduleData || !("name" in moduleData && "events" in moduleData)) continue;
@@ -28,7 +27,8 @@ async function registerModules(client, directory) {
28
27
  client.stores.modules.set(moduleData.name, moduleData);
29
28
  }
30
29
  }
31
-
32
- export { bindModules, registerModules as default };
33
- //# sourceMappingURL=registry.modules.js.map
30
+ export {
31
+ bindModules,
32
+ registerModules as default
33
+ };
34
34
  //# sourceMappingURL=registry.modules.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/modules/registry.modules.ts"],"names":["fs"],"mappings":";;;;;AAMA,eAAsB,YAAY,MAAA,EAAwB;AACzD,EAAA,KAAA,MAAW,UAAA,IAAc,MAAA,CAAO,MAAA,CAAO,OAAA,CAAQ,QAAO,EAAG;AACxD,IAAA,KAAA,MAAW,CAAC,MAAM,OAAO,CAAA,IAAK,OAAO,OAAA,CAAQ,UAAA,CAAW,MAAM,CAAA,EAAG;AAChE,MAAA,MAAM,WAAW,CAAA,GAAI,IAAA,KACpB,KAAM,OAAA,CAAgE,MAAA,EAAQ,GAAG,IAAI,CAAA;AAEtF,MAAA,MAAA,CAAO,EAAA,CAAG,MAAM,QAAQ,CAAA;AAAA,IACzB;AAAA,EACD;AACD;AAEA,eAAO,eAAA,CAAuC,QAAwB,SAAA,EAAmB;AACxF,EAAA,IAAI,CAAC,WAAW,SAAS,CAAA;AACxB,IAAA,MAAM,IAAI,aAAA;AAAA,MACT,iDAAiD,SAAS,CAAA,iBAAA,CAAA;AAAA,MAC1D;AAAA,KACD;AAED,EAAA,MAAM,QAAQA,QAAA,CAAG,IAAA,CAAK,IAAA,CAAK,SAAA,EAAW,SAAS,CAAC,CAAA;AAChD,EAAA,WAAA,MAAiB,QAAQ,KAAA,EAAO;AAC/B,IAAA,MAAM,UAAA,GAAa,MAAM,UAAA,CAAmB,IAAI,CAAA;AAChD,IAAA,IAAI,CAAC,UAAA,IAAc,EAAE,MAAA,IAAU,UAAA,IAAc,YAAY,UAAA,CAAA,EAAa;AAEtE,IAAA,IAAI,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,GAAA,CAAI,WAAW,IAAI,CAAA;AAC3C,MAAA,OAAA,CAAQ,IAAA;AAAA,QACP,CAAA,mBAAA,EAAsB,WAAW,IAAI,CAAA,yCAAA;AAAA,OACtC;AAED,IAAA,MAAA,CAAO,MAAA,CAAO,OAAA,CAAQ,GAAA,CAAI,UAAA,CAAW,MAAM,UAAU,CAAA;AAAA,EACtD;AACD","file":"registry.modules.js","sourcesContent":["import { Module, TriviousClient } from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport { importFile } from \"#utility/functions.js\";\nimport { existsSync, promises as fs } from \"fs\";\nimport { join } from \"path\";\n\nexport async function bindModules(client: TriviousClient) {\n\tfor (const moduleData of client.stores.modules.values()) {\n\t\tfor (const [name, handler] of Object.entries(moduleData.events)) {\n\t\t\tconst listener = (...args: unknown[]) =>\n\t\t\t\tvoid (handler as (client: TriviousClient, ...args: unknown[]) => any)(client, ...args);\n\n\t\t\tclient.on(name, listener);\n\t\t}\n\t}\n}\n\nexport default async function registerModules(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register modules; passed directory '${directory}' does not exist!`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst moduleData = await importFile<Module>(file);\n\t\tif (!moduleData || !(\"name\" in moduleData && \"events\" in moduleData)) continue;\n\n\t\tif (client.stores.events.get(moduleData.name))\n\t\t\tconsole.warn(\n\t\t\t\t`[Trivious] Module '${moduleData.name}' has a duplicate and has been overridden`\n\t\t\t);\n\n\t\tclient.stores.modules.set(moduleData.name, moduleData);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/modules/registry.modules.ts"],"sourcesContent":["import { Module, TriviousClient } from \"@typings\";\nimport { TriviousError } from \"@utility/errors.js\";\nimport { importFile } from \"@utility/functions.js\";\nimport { existsSync, promises as fs } from \"fs\";\nimport { join } from \"path\";\n\nexport async function bindModules(client: TriviousClient) {\n\tfor (const moduleData of client.stores.modules.values()) {\n\t\tfor (const [name, handler] of Object.entries(moduleData.events)) {\n\t\t\tconst listener = (...args: unknown[]) =>\n\t\t\t\tvoid (handler as (client: TriviousClient, ...args: unknown[]) => any)(client, ...args);\n\n\t\t\tclient.on(name, listener);\n\t\t}\n\t}\n}\n\nexport default async function registerModules(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register modules; passed directory '${directory}' does not exist!`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst moduleData = await importFile<Module>(file);\n\t\tif (!moduleData || !(\"name\" in moduleData && \"events\" in moduleData)) continue;\n\n\t\tif (client.stores.events.get(moduleData.name))\n\t\t\tconsole.warn(\n\t\t\t\t`[Trivious] Module '${moduleData.name}' has a duplicate and has been overridden`\n\t\t\t);\n\n\t\tclient.stores.modules.set(moduleData.name, moduleData);\n\t}\n}\n"],"mappings":"AACA,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,YAAY,YAAY,UAAU;AAC3C,SAAS,YAAY;AAErB,eAAsB,YAAY,QAAwB;AACzD,aAAW,cAAc,OAAO,OAAO,QAAQ,OAAO,GAAG;AACxD,eAAW,CAAC,MAAM,OAAO,KAAK,OAAO,QAAQ,WAAW,MAAM,GAAG;AAChE,YAAM,WAAW,IAAI,SACpB,KAAM,QAAgE,QAAQ,GAAG,IAAI;AAEtF,aAAO,GAAG,MAAM,QAAQ;AAAA,IACzB;AAAA,EACD;AACD;AAEA,eAAO,gBAAuC,QAAwB,WAAmB;AACxF,MAAI,CAAC,WAAW,SAAS;AACxB,UAAM,IAAI;AAAA,MACT,iDAAiD,SAAS;AAAA,MAC1D;AAAA,IACD;AAED,QAAM,QAAQ,GAAG,KAAK,KAAK,WAAW,SAAS,CAAC;AAChD,mBAAiB,QAAQ,OAAO;AAC/B,UAAM,aAAa,MAAM,WAAmB,IAAI;AAChD,QAAI,CAAC,cAAc,EAAE,UAAU,cAAc,YAAY,YAAa;AAEtE,QAAI,OAAO,OAAO,OAAO,IAAI,WAAW,IAAI;AAC3C,cAAQ;AAAA,QACP,sBAAsB,WAAW,IAAI;AAAA,MACtC;AAED,WAAO,OAAO,QAAQ,IAAI,WAAW,MAAM,UAAU;AAAA,EACtD;AACD;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { GuildMember, User } from 'discord.js';
2
- import { T as TriviousClient, a as BaseCommandData, d as Component } from '../../modules.types-lYoNHt-m.js';
2
+ import { T as TriviousClient, a as BaseCommandData, f as Component } from '../../modules.types-STECtgbF.js';
3
3
  import '../client/client.types.js';
4
4
  import './permissions.types.js';
5
5
 
@@ -36,7 +36,8 @@ function canUserRunCommand(client, command, user) {
36
36
  if (!userIds) return [true, "No permissions set"];
37
37
  return userIds.includes(user.id) ? [true, "User can run command"] : [false, "User cannot run command"];
38
38
  }
39
-
40
- export { canMemberRunCommand, canUserRunCommand };
41
- //# sourceMappingURL=methods.permissions.js.map
39
+ export {
40
+ canMemberRunCommand,
41
+ canUserRunCommand
42
+ };
42
43
  //# sourceMappingURL=methods.permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/permissions/methods.permissions.ts"],"names":[],"mappings":"AAGO,SAAS,mBAAA,CACf,MAAA,EACA,OAAA,EACA,MAAA,EACoB;AACpB,EAAA,MAAM,EAAE,aAAY,GAAI,OAAA;AACxB,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,CAAC,MAAM,oBAAoB,CAAA;AAEpD,EAAA,IAAI,MAAA,CAAO,SAAS,YAAA,IAAgB,MAAA,CAAO,SAAS,YAAA,CAAa,QAAA,CAAS,MAAA,CAAO,IAAA,CAAK,EAAE,CAAA;AACvF,IAAA,OAAO,CAAC,MAAM,sBAAsB,CAAA;AAErC,EAAA,MAAM,EAAE,yBAAA,EAA2B,eAAA,EAAiB,OAAA,EAAQ,GAAI,WAAA;AAChE,EAAA,IAAI,SAAS,OAAO,iBAAA,CAAkB,MAAA,EAAQ,OAAA,EAAS,OAAO,IAAI,CAAA;AAElE,EAAA,IAAI,mBAAA,GAAsB,KAAA;AAC1B,EAAA,IAAI,aAAA,GAAgB,KAAA;AAEpB,EAAA,IAAI,yBAAA,EAA2B;AAC9B,IAAA,KAAA,MAAW,OAAO,yBAAA,EAA2B;AAC5C,MAAA,IAAI,MAAA,CAAO,WAAA,CAAY,GAAA,CAAI,GAAG,CAAA,EAAG;AAChC,QAAA,mBAAA,GAAsB,IAAA;AACtB,QAAA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,EAAA,IAAI,eAAA,EAAiB;AACpB,IAAA,KAAA,MAAW,UAAU,eAAA,EAAiB;AACrC,MAAA,IAAI,MAAA,CAAO,KAAA,CAAM,KAAA,CAAM,GAAA,CAAI,MAAM,CAAA,EAAG;AACnC,QAAA,aAAA,GAAgB,IAAA;AAChB,QAAA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,EAAA,OAAO,mBAAA,IAAuB,gBAC3B,CAAC,IAAA,EAAM,sBAAsB,CAAA,GAC7B,CAAC,OAAO,yBAAyB,CAAA;AACrC;AAEO,SAAS,iBAAA,CACf,MAAA,EACA,OAAA,EACA,IAAA,EACoB;AACpB,EAAA,MAAM,EAAE,aAAY,GAAI,OAAA;AACxB,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,CAAC,MAAM,oBAAoB,CAAA;AAEpD,EAAA,IAAI,MAAA,CAAO,SAAS,YAAA,IAAgB,MAAA,CAAO,SAAS,YAAA,CAAa,QAAA,CAAS,KAAK,EAAE,CAAA;AAChF,IAAA,OAAO,CAAC,MAAM,sBAAsB,CAAA;AAErC,EAAA,MAAM,EAAE,yBAAA,EAA2B,eAAA,EAAiB,OAAA,EAAQ,GAAI,WAAA;AAEhE,EAAA,IAAI,CAAC,YAAY,yBAAA,IAA6B,eAAA,CAAA;AAC7C,IAAA,OAAO,CAAC,OAAO,8DAA8D,CAAA;AAE9E,EAAA,IAAI,CAAC,OAAA,EAAS,OAAO,CAAC,MAAM,oBAAoB,CAAA;AAChD,EAAA,OAAO,OAAA,CAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAA,GAC5B,CAAC,IAAA,EAAM,sBAAsB,CAAA,GAC7B,CAAC,KAAA,EAAO,yBAAyB,CAAA;AACrC","file":"methods.permissions.js","sourcesContent":["import { BaseCommandData, Component, TriviousClient } from \"#typings\";\nimport { GuildMember, User } from \"discord.js\";\n\nexport function canMemberRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tmember: GuildMember\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(member.user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\tif (userIds) return canUserRunCommand(client, command, member.user);\n\n\tlet memberHasPermission = false;\n\tlet memberHasRole = false;\n\n\tif (requiredMemberPermissions) {\n\t\tfor (const bit of requiredMemberPermissions) {\n\t\t\tif (member.permissions.has(bit)) {\n\t\t\t\tmemberHasPermission = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (requiredRoleIds) {\n\t\tfor (const roleId of requiredRoleIds) {\n\t\t\tif (member.roles.cache.has(roleId)) {\n\t\t\t\tmemberHasRole = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn memberHasPermission || memberHasRole\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n\nexport function canUserRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tuser: User\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\n\tif (!userIds && (requiredMemberPermissions || requiredRoleIds))\n\t\treturn [false, \"Cannot validate permissions; use canMemberRunCommand instead\"];\n\n\tif (!userIds) return [true, \"No permissions set\"];\n\treturn userIds.includes(user.id)\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/permissions/methods.permissions.ts"],"sourcesContent":["import { BaseCommandData, Component, TriviousClient } from \"@typings\";\nimport { GuildMember, User } from \"discord.js\";\n\nexport function canMemberRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tmember: GuildMember\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(member.user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\tif (userIds) return canUserRunCommand(client, command, member.user);\n\n\tlet memberHasPermission = false;\n\tlet memberHasRole = false;\n\n\tif (requiredMemberPermissions) {\n\t\tfor (const bit of requiredMemberPermissions) {\n\t\t\tif (member.permissions.has(bit)) {\n\t\t\t\tmemberHasPermission = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (requiredRoleIds) {\n\t\tfor (const roleId of requiredRoleIds) {\n\t\t\tif (member.roles.cache.has(roleId)) {\n\t\t\t\tmemberHasRole = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn memberHasPermission || memberHasRole\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n\nexport function canUserRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tuser: User\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\n\tif (!userIds && (requiredMemberPermissions || requiredRoleIds))\n\t\treturn [false, \"Cannot validate permissions; use canMemberRunCommand instead\"];\n\n\tif (!userIds) return [true, \"No permissions set\"];\n\treturn userIds.includes(user.id)\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n"],"mappings":"AAGO,SAAS,oBACf,QACA,SACA,QACoB;AACpB,QAAM,EAAE,YAAY,IAAI;AACxB,MAAI,CAAC,YAAa,QAAO,CAAC,MAAM,oBAAoB;AAEpD,MAAI,OAAO,SAAS,gBAAgB,OAAO,SAAS,aAAa,SAAS,OAAO,KAAK,EAAE;AACvF,WAAO,CAAC,MAAM,sBAAsB;AAErC,QAAM,EAAE,2BAA2B,iBAAiB,QAAQ,IAAI;AAChE,MAAI,QAAS,QAAO,kBAAkB,QAAQ,SAAS,OAAO,IAAI;AAElE,MAAI,sBAAsB;AAC1B,MAAI,gBAAgB;AAEpB,MAAI,2BAA2B;AAC9B,eAAW,OAAO,2BAA2B;AAC5C,UAAI,OAAO,YAAY,IAAI,GAAG,GAAG;AAChC,8BAAsB;AACtB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,MAAI,iBAAiB;AACpB,eAAW,UAAU,iBAAiB;AACrC,UAAI,OAAO,MAAM,MAAM,IAAI,MAAM,GAAG;AACnC,wBAAgB;AAChB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,SAAO,uBAAuB,gBAC3B,CAAC,MAAM,sBAAsB,IAC7B,CAAC,OAAO,yBAAyB;AACrC;AAEO,SAAS,kBACf,QACA,SACA,MACoB;AACpB,QAAM,EAAE,YAAY,IAAI;AACxB,MAAI,CAAC,YAAa,QAAO,CAAC,MAAM,oBAAoB;AAEpD,MAAI,OAAO,SAAS,gBAAgB,OAAO,SAAS,aAAa,SAAS,KAAK,EAAE;AAChF,WAAO,CAAC,MAAM,sBAAsB;AAErC,QAAM,EAAE,2BAA2B,iBAAiB,QAAQ,IAAI;AAEhE,MAAI,CAAC,YAAY,6BAA6B;AAC7C,WAAO,CAAC,OAAO,8DAA8D;AAE9E,MAAI,CAAC,QAAS,QAAO,CAAC,MAAM,oBAAoB;AAChD,SAAO,QAAQ,SAAS,KAAK,EAAE,IAC5B,CAAC,MAAM,sBAAsB,IAC7B,CAAC,OAAO,yBAAyB;AACrC;","names":[]}
@@ -1,8 +1,6 @@
1
- import { PermissionsBitField } from 'discord.js';
2
-
3
1
  interface CommandPermissionValues {
4
2
  requiredRoleIds?: string[];
5
- requiredMemberPermissions?: PermissionsBitField[];
3
+ requiredMemberPermissions?: bigint[];
6
4
  userIds?: string[];
7
5
  }
8
6
 
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=permissions.types.js.map
3
1
  //# sourceMappingURL=permissions.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"permissions.types.js"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,20 +1,19 @@
1
- import { existsSync } from 'fs';
2
- import { dirname, join, resolve } from 'path';
3
- import { fileURLToPath } from 'url';
4
- import { Collection } from 'discord.js';
5
-
6
- const __filename$1 = fileURLToPath(import.meta.url);
7
- const __dirname$1 = dirname(__filename$1);
1
+ import { existsSync } from "fs";
2
+ import { dirname, join, resolve } from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { Collection } from "discord.js";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
8
7
  const structure = {
9
8
  getPackageRoot() {
10
- let dir = __dirname$1;
9
+ let dir = __dirname;
11
10
  while (dir !== dirname(dir)) {
12
11
  if (existsSync(join(dir, "package.json")) || existsSync(join(dir, "node_modules"))) {
13
12
  return dir;
14
13
  }
15
14
  dir = dirname(dir);
16
15
  }
17
- return __dirname$1;
16
+ return __dirname;
18
17
  },
19
18
  resolveRelativePath(relativePath) {
20
19
  const workingDir = process.cwd();
@@ -45,7 +44,7 @@ const structure = {
45
44
  }
46
45
  };
47
46
  var index_structure_default = structure;
48
-
49
- export { index_structure_default as default };
50
- //# sourceMappingURL=index.structure.js.map
47
+ export {
48
+ index_structure_default as default
49
+ };
51
50
  //# sourceMappingURL=index.structure.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/structure/index.structure.ts"],"names":["__filename","__dirname"],"mappings":";;;;;AAOA,MAAMA,YAAA,GAAa,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AAChD,MAAMC,WAAA,GAAY,QAAQD,YAAU,CAAA;AAEp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;AACtD,IAAA,MAAM,kBAAA,GAAqC,CAAC,UAAA,EAAY,YAAA,EAAc,UAAU,SAAS,CAAA;AAEzF,IAAA,KAAA,MAAW,OAAO,kBAAA,EAAoB;AACrC,MAAA,MAAM,WAAW,SAAA,CAAU,mBAAA,CAAoB,IAAA,CAAK,QAAA,EAAU,GAAG,CAAC,CAAA;AAClE,MAAA,IAAI,CAAC,UAAA,CAAW,QAAQ,CAAA,EAAG;AAC3B,MAAA,QAAA,CAAS,GAAA,CAAI,KAAK,QAAQ,CAAA;AAAA,IAC3B;AAEA,IAAA,OAAO,QAAA;AAAA,EACR;AACD,CAAA;AAEA,IAAO,uBAAA,GAAQ","file":"index.structure.js","sourcesContent":["import { existsSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { Collection } from \"discord.js\";\n\ntype ClientStores = \"commands\" | \"components\" | \"events\" | \"modules\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst structure = {\n\tgetPackageRoot() {\n\t\tlet dir = __dirname;\n\n\t\twhile (dir !== dirname(dir)) {\n\t\t\tif (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \"node_modules\"))) {\n\t\t\t\treturn dir;\n\t\t\t}\n\n\t\t\tdir = dirname(dir);\n\t\t}\n\n\t\treturn __dirname;\n\t},\n\n\tresolveRelativePath(relativePath: string) {\n\t\tconst workingDir = process.cwd();\n\t\tconst packageRoot = this.getPackageRoot();\n\n\t\tconst candidates = [\n\t\t\tjoin(workingDir, \"lib\", relativePath),\n\t\t\tjoin(workingDir, \"dist\", relativePath),\n\t\t\tjoin(packageRoot, \"lib\", relativePath),\n\t\t\tjoin(packageRoot, \"dist\", relativePath),\n\n\t\t\tjoin(packageRoot, relativePath),\n\t\t\tjoin(workingDir, relativePath),\n\t\t];\n\n\t\tfor (const candidate of candidates) {\n\t\t\tconst full = resolve(candidate);\n\t\t\tif (existsSync(full)) return full;\n\t\t}\n\n\t\treturn join(workingDir, relativePath);\n\t},\n\n\tresolveTypeBasedStructure(corePath: string) {\n\t\tconst resolved = new Collection<ClientStores, string>();\n\t\tconst directoriesToCheck: ClientStores[] = [\"commands\", \"components\", \"events\", \"modules\"];\n\n\t\tfor (const dir of directoriesToCheck) {\n\t\t\tconst fullPath = structure.resolveRelativePath(join(corePath, dir));\n\t\t\tif (!existsSync(fullPath)) continue;\n\t\t\tresolved.set(dir, fullPath);\n\t\t}\n\n\t\treturn resolved;\n\t},\n};\n\nexport default structure;\n"]}
1
+ {"version":3,"sources":["../../../src/features/structure/index.structure.ts"],"sourcesContent":["import { existsSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { Collection } from \"discord.js\";\n\ntype ClientStores = \"commands\" | \"components\" | \"events\" | \"modules\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst structure = {\n\tgetPackageRoot() {\n\t\tlet dir = __dirname;\n\n\t\twhile (dir !== dirname(dir)) {\n\t\t\tif (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \"node_modules\"))) {\n\t\t\t\treturn dir;\n\t\t\t}\n\n\t\t\tdir = dirname(dir);\n\t\t}\n\n\t\treturn __dirname;\n\t},\n\n\tresolveRelativePath(relativePath: string) {\n\t\tconst workingDir = process.cwd();\n\t\tconst packageRoot = this.getPackageRoot();\n\n\t\tconst candidates = [\n\t\t\tjoin(workingDir, \"lib\", relativePath),\n\t\t\tjoin(workingDir, \"dist\", relativePath),\n\t\t\tjoin(packageRoot, \"lib\", relativePath),\n\t\t\tjoin(packageRoot, \"dist\", relativePath),\n\n\t\t\tjoin(packageRoot, relativePath),\n\t\t\tjoin(workingDir, relativePath),\n\t\t];\n\n\t\tfor (const candidate of candidates) {\n\t\t\tconst full = resolve(candidate);\n\t\t\tif (existsSync(full)) return full;\n\t\t}\n\n\t\treturn join(workingDir, relativePath);\n\t},\n\n\tresolveTypeBasedStructure(corePath: string) {\n\t\tconst resolved = new Collection<ClientStores, string>();\n\t\tconst directoriesToCheck: ClientStores[] = [\"commands\", \"components\", \"events\", \"modules\"];\n\n\t\tfor (const dir of directoriesToCheck) {\n\t\t\tconst fullPath = structure.resolveRelativePath(join(corePath, dir));\n\t\t\tif (!existsSync(fullPath)) continue;\n\t\t\tresolved.set(dir, fullPath);\n\t\t}\n\n\t\treturn resolved;\n\t},\n};\n\nexport default structure;\n"],"mappings":"AAAA,SAAS,kBAAkB;AAC3B,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAI3B,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAEpC,MAAM,YAAY;AAAA,EACjB,iBAAiB;AAChB,QAAI,MAAM;AAEV,WAAO,QAAQ,QAAQ,GAAG,GAAG;AAC5B,UAAI,WAAW,KAAK,KAAK,cAAc,CAAC,KAAK,WAAW,KAAK,KAAK,cAAc,CAAC,GAAG;AACnF,eAAO;AAAA,MACR;AAEA,YAAM,QAAQ,GAAG;AAAA,IAClB;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,oBAAoB,cAAsB;AACzC,UAAM,aAAa,QAAQ,IAAI;AAC/B,UAAM,cAAc,KAAK,eAAe;AAExC,UAAM,aAAa;AAAA,MAClB,KAAK,YAAY,OAAO,YAAY;AAAA,MACpC,KAAK,YAAY,QAAQ,YAAY;AAAA,MACrC,KAAK,aAAa,OAAO,YAAY;AAAA,MACrC,KAAK,aAAa,QAAQ,YAAY;AAAA,MAEtC,KAAK,aAAa,YAAY;AAAA,MAC9B,KAAK,YAAY,YAAY;AAAA,IAC9B;AAEA,eAAW,aAAa,YAAY;AACnC,YAAM,OAAO,QAAQ,SAAS;AAC9B,UAAI,WAAW,IAAI,EAAG,QAAO;AAAA,IAC9B;AAEA,WAAO,KAAK,YAAY,YAAY;AAAA,EACrC;AAAA,EAEA,0BAA0B,UAAkB;AAC3C,UAAM,WAAW,IAAI,WAAiC;AACtD,UAAM,qBAAqC,CAAC,YAAY,cAAc,UAAU,SAAS;AAEzF,eAAW,OAAO,oBAAoB;AACrC,YAAM,WAAW,UAAU,oBAAoB,KAAK,UAAU,GAAG,CAAC;AAClE,UAAI,CAAC,WAAW,QAAQ,EAAG;AAC3B,eAAS,IAAI,KAAK,QAAQ;AAAA,IAC3B;AAEA,WAAO;AAAA,EACR;AACD;AAEA,IAAO,0BAAQ;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from './features/client/client.types.js';
2
- export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CommandFlags, c as CommandFunction, d as Component, e as ComponentContext, f as ComponentFlags, g as ComponentInteraction, h as ContextCommandData, E as Event, M as Module, S as SlashCommandData, i as SlashSubcommandData, j as SlashSubcommandGroupData, T as TriviousClient } from './modules.types-lYoNHt-m.js';
2
+ export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CollatedCommandData, c as CommandFlags, d as CommandFunction, e as CommandSetData, f as Component, g as ComponentContext, h as ComponentFlags, i as ComponentInteraction, j as ContextCommandData, E as Event, M as Module, S as SlashCommandData, k as SlashSubcommandData, l as SlashSubcommandGroupData, T as TriviousClient } from './modules.types-STECtgbF.js';
3
3
  export { ComponentCustomId, ComponentTag } from './features/customId/customid.types.js';
4
4
  export { CommandPermissionValues } from './features/permissions/permissions.types.js';
5
5
  export { createActionRow, createEmbed } from './features/builders/utility.builders.js';