trivious 2.2.5 → 2.3.1

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