xernerx 3.4.3 → 3.5.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 (66) hide show
  1. package/README.md +10 -10
  2. package/dist/build/ContextCommandBuilder.d.ts +60 -42
  3. package/dist/build/ContextCommandBuilder.js +93 -86
  4. package/dist/build/EventBuilder.d.ts +21 -17
  5. package/dist/build/EventBuilder.js +34 -35
  6. package/dist/build/InhibitorBuilder.d.ts +19 -20
  7. package/dist/build/InhibitorBuilder.js +27 -27
  8. package/dist/build/MessageCommandBuilder.d.ts +53 -42
  9. package/dist/build/MessageCommandBuilder.js +90 -78
  10. package/dist/build/SlashCommandBuilder.d.ts +58 -40
  11. package/dist/build/SlashCommandBuilder.js +125 -118
  12. package/dist/client/XernerxClient.d.ts +28 -28
  13. package/dist/client/XernerxClient.js +101 -83
  14. package/dist/handlers/CommandHandler.d.ts +27 -27
  15. package/dist/handlers/CommandHandler.js +42 -42
  16. package/dist/handlers/EventHandler.d.ts +13 -13
  17. package/dist/handlers/EventHandler.js +16 -16
  18. package/dist/handlers/Handler.d.ts +57 -57
  19. package/dist/handlers/Handler.js +250 -250
  20. package/dist/handlers/InhibitorHandler.d.ts +18 -18
  21. package/dist/handlers/InhibitorHandler.js +21 -21
  22. package/dist/main.cjs +2023 -0
  23. package/dist/main.d.ts +30 -30
  24. package/dist/main.js +42 -42
  25. package/dist/models/CommandArguments.d.ts +17 -17
  26. package/dist/models/CommandArguments.js +121 -123
  27. package/dist/models/Events.d.ts +24 -24
  28. package/dist/models/Events.js +294 -304
  29. package/dist/models/Extensions.d.ts +7 -7
  30. package/dist/models/Extensions.js +23 -23
  31. package/dist/tools/XernerxError.d.ts +5 -5
  32. package/dist/tools/XernerxError.js +8 -8
  33. package/dist/tools/package.d.ts +49 -38
  34. package/dist/tools/package.js +48 -41
  35. package/dist/types/enums.d.ts +35 -35
  36. package/dist/types/enums.js +35 -35
  37. package/dist/types/interfaces.d.ts +25 -25
  38. package/dist/types/interfaces.js +1 -1
  39. package/dist/types/options.d.ts +241 -206
  40. package/dist/types/options.js +1 -1
  41. package/dist/types/types.d.ts +34 -32
  42. package/dist/types/types.js +1 -1
  43. package/dist/utils/ClientUtil.d.ts +25 -25
  44. package/dist/utils/ClientUtil.js +222 -218
  45. package/dist/utils/CommandUtil.d.ts +56 -56
  46. package/dist/utils/CommandUtil.js +248 -260
  47. package/dist/validators/CommandValidations.d.ts +7 -7
  48. package/dist/validators/CommandValidations.js +183 -185
  49. package/dist/validators/InhibitorValidations.d.ts +11 -11
  50. package/dist/validators/InhibitorValidations.js +42 -42
  51. package/dist/validators/Shapes.js +1 -0
  52. package/package.json +54 -39
  53. package/dist/build/XContextCommandBuilder.d.ts +0 -40
  54. package/dist/build/XContextCommandBuilder.js +0 -84
  55. package/dist/build/XEventBuilder.d.ts +0 -17
  56. package/dist/build/XEventBuilder.js +0 -35
  57. package/dist/build/XInhibitorBuilder.d.ts +0 -20
  58. package/dist/build/XInhibitorBuilder.js +0 -28
  59. package/dist/build/XMessageCommandBuilder.d.ts +0 -42
  60. package/dist/build/XMessageCommandBuilder.js +0 -80
  61. package/dist/build/XSlashCommandBuilder.d.ts +0 -36
  62. package/dist/build/XSlashCommandBuilder.js +0 -114
  63. package/dist/models/CommandValidations.d.ts +0 -4
  64. package/dist/models/CommandValidations.js +0 -183
  65. package/dist/models/InhibitorValidations.d.ts +0 -12
  66. package/dist/models/InhibitorValidations.js +0 -42
@@ -1,42 +0,0 @@
1
- import { InhibitorType } from "../types/enums.js";
2
- export class InhibitorValidation {
3
- client;
4
- action;
5
- command;
6
- inhibited;
7
- constructor(client, action, command) {
8
- this.client = client;
9
- this.action = action;
10
- this.command = command;
11
- this.inhibited = {};
12
- }
13
- async inhibit() {
14
- for (const inhibitor of this.client.inhibitors) {
15
- const inhibit = inhibitor[1];
16
- if (inhibit)
17
- this.inhibited[inhibit.name] = await inhibit.check(this.action, this.args(this.action, inhibit.type));
18
- }
19
- for (const inhibit of Object.values(this.inhibited)) {
20
- if (inhibit)
21
- return this.inhibited;
22
- }
23
- }
24
- args(action, type) {
25
- if (type === InhibitorType.Channel)
26
- return action.channel;
27
- if (type === InhibitorType.User)
28
- return action.author || action.user;
29
- if (type === InhibitorType.Guild)
30
- return action.guild;
31
- if (type === InhibitorType.Member)
32
- return action.member;
33
- // if (type === InhibitorType.Command)
34
- // return this.client.util.getAllCommands().filter(this.command.name);
35
- // if (type === InhibitorType.MessageCommand)
36
- // return this.client.util.getAllMessageCommands().find(this.command.name);
37
- // if (type === InhibitorType.SlashCommand)
38
- // return this.client.util.getAllSlashCommands().find(this.command.name);
39
- // if (type === InhibitorType.ContextCommand)
40
- // return this.client.util.getAllContextCommands().find(this.command.name);
41
- }
42
- }