xernerx 4.5.9 → 4.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +68 -12
  2. package/dist/build/XernerxContextCommand.d.ts +8 -3
  3. package/dist/build/XernerxContextCommand.d.ts.map +1 -1
  4. package/dist/build/XernerxContextCommand.js +10 -1
  5. package/dist/build/XernerxContextCommand.js.map +1 -1
  6. package/dist/build/XernerxEvent.d.ts +4 -4
  7. package/dist/build/XernerxEvent.d.ts.map +1 -1
  8. package/dist/build/XernerxEvent.js +5 -2
  9. package/dist/build/XernerxEvent.js.map +1 -1
  10. package/dist/build/XernerxInhibitor.d.ts +17 -10
  11. package/dist/build/XernerxInhibitor.d.ts.map +1 -1
  12. package/dist/build/XernerxInhibitor.js +10 -1
  13. package/dist/build/XernerxInhibitor.js.map +1 -1
  14. package/dist/build/XernerxMessageCommand.d.ts +16 -6
  15. package/dist/build/XernerxMessageCommand.d.ts.map +1 -1
  16. package/dist/build/XernerxMessageCommand.js +15 -1
  17. package/dist/build/XernerxMessageCommand.js.map +1 -1
  18. package/dist/build/XernerxSlashCommand.d.ts +20 -4
  19. package/dist/build/XernerxSlashCommand.d.ts.map +1 -1
  20. package/dist/build/XernerxSlashCommand.js +21 -1
  21. package/dist/build/XernerxSlashCommand.js.map +1 -1
  22. package/dist/client/XernerxClient.d.ts +3 -0
  23. package/dist/client/XernerxClient.d.ts.map +1 -1
  24. package/dist/client/XernerxClient.js +3 -0
  25. package/dist/client/XernerxClient.js.map +1 -1
  26. package/dist/client/XernerxShardClient.d.ts +1 -0
  27. package/dist/client/XernerxShardClient.d.ts.map +1 -1
  28. package/dist/client/XernerxShardClient.js +2 -4
  29. package/dist/client/XernerxShardClient.js.map +1 -1
  30. package/dist/functions/load.d.ts +2 -2
  31. package/dist/functions/load.js +2 -2
  32. package/dist/functions/load.js.map +1 -1
  33. package/dist/functions/reload.js +13 -13
  34. package/dist/functions/reload.js.map +1 -1
  35. package/dist/handlers/CommandHandler.d.ts.map +1 -1
  36. package/dist/handlers/CommandHandler.js +16 -13
  37. package/dist/handlers/CommandHandler.js.map +1 -1
  38. package/dist/handlers/EventHandler.js +2 -2
  39. package/dist/handlers/EventHandler.js.map +1 -1
  40. package/dist/handlers/Handler.d.ts +2 -2
  41. package/dist/handlers/Handler.js +5 -5
  42. package/dist/handlers/Handler.js.map +1 -1
  43. package/dist/handlers/InhibitorHandler.js +2 -2
  44. package/dist/handlers/InhibitorHandler.js.map +1 -1
  45. package/dist/models/Arguments.js +2 -2
  46. package/dist/models/Arguments.js.map +1 -1
  47. package/dist/tools/XernerxLog.d.ts +2 -1
  48. package/dist/tools/XernerxLog.d.ts.map +1 -1
  49. package/dist/tools/XernerxLog.js +2 -4
  50. package/dist/tools/XernerxLog.js.map +1 -1
  51. package/dist/tools/XernerxText.d.ts +30 -0
  52. package/dist/tools/XernerxText.d.ts.map +1 -0
  53. package/dist/tools/XernerxText.js +81 -0
  54. package/dist/tools/XernerxText.js.map +1 -0
  55. package/dist/types/extenders.d.ts +2 -1
  56. package/dist/types/extenders.d.ts.map +1 -1
  57. package/dist/types/extenders.js.map +1 -1
  58. package/dist/types/interfaces.d.ts +4 -1
  59. package/dist/types/interfaces.d.ts.map +1 -1
  60. package/dist/types/interfaces.js.map +1 -1
  61. package/dist/types/types.d.ts +1 -1
  62. package/dist/types/types.js.map +1 -1
  63. package/dist/utils/Util.d.ts +3 -1
  64. package/dist/utils/Util.d.ts.map +1 -1
  65. package/dist/utils/Util.js +2 -1
  66. package/dist/utils/Util.js.map +1 -1
  67. package/dist/validators/inhibitorValidations.d.ts +1 -1
  68. package/package.json +1 -1
package/README.md CHANGED
@@ -1,21 +1,77 @@
1
+ <!-- @format -->
2
+
3
+ <style>
4
+ body {
5
+ background: rgba(0,0,0, 0.2);
6
+ border-radius: 0.5rem;
7
+ margin: 10px;
8
+ }
9
+
10
+ :hover {
11
+ color: #8979f0;
12
+ }
13
+
14
+ </style>
15
+
16
+ [![](./docs/icons/Xernerx%20-%20Logo%20-%20Purple.png)](https://xernerx.github.io/xernerx)
17
+
1
18
  # xernerx
2
19
 
3
20
  Xernerx is a class based discord.js framework. \[BETA\]
4
21
 
5
- ## Includes
22
+ It can be customized to be a lightweight handler or a heavy customizable framework that does all the hard work for you
23
+
24
+ ## Features
25
+
26
+ > - [x] Slash command handler
27
+ > - [x] Message command handler
28
+ > - [x] Context command handler
29
+ > - [x] Event handler (with custom Events)
30
+ > - [x] Inhibitor handler
31
+ > - [x] Extension handler
32
+ > - [x] Client Utilities
33
+ > - [x] Message Utilities
34
+ > - [x] Interaction Utilities
35
+ > - [x] Message command handles
36
+ > - [x] Extension support
37
+ > - [x] ShardClient
38
+
39
+ ## Links
40
+
41
+ > - [Documentation](https://xernerx.github.io/xernerx/docs/#v4)
42
+ > - [Guide](https://xernerx.github.io/xernerx/guide/#v4)
43
+
44
+ ## Setup
45
+
46
+ ### Settings
47
+
48
+ ```js
49
+ import XernerxClient from 'xernerx';
50
+
51
+ new (class Client extends XernerxClient {
52
+ constructor() {
53
+ super([discordOptions], [xernerxOptions]);
54
+
55
+ this.connect('token');
56
+ }
57
+ })();
58
+ ```
59
+
60
+ ### Handlers
61
+
62
+ There are 5 handlers total
63
+
64
+ > - Command handler, handles message, slash and context commands
65
+ > - Event handler, has all the Discord.js events and more
66
+ > - Inhibitor handler, handles conditions before commands are ran globally
67
+ > - Extension handler, more info [here](#Extensions)
68
+ > - Webhook handler, will allow for top.gg to get your stats (needs a rework)
6
69
 
7
- > - Slash command handler
8
- > - Message command handler
9
- > - Context command handler
10
- > - Event handler (with custom Events)
11
- > - Inhibitor handler
12
- > - Custom utilities
13
- > - Message command handles
14
- > - Extension support
70
+ ## Extensions
15
71
 
16
- You can checkout the docs [here](https://xernerx.github.io/xernerx/home.html)
72
+ Xernerx supports the ability to use extensions, features not initially included into your code. You can use any extension based on the [xernerx-extension-builder](https://npmjs.com/xernerx-extension-builder) package, or make your own with it!
17
73
 
18
74
  ## Notes
19
75
 
20
- - Only compatible with ESM
21
- - TypeScript and JavaScript support
76
+ - Only compatible with ESM
77
+ - TypeScript and JavaScript support
@@ -42,10 +42,15 @@ export default class XernerxContextCommand {
42
42
  fetchReply?: boolean | undefined;
43
43
  }
44
44
  | undefined;
45
- readonly fileType: 'ContextCommand';
46
- readonly filePath: string;
45
+ readonly filetype: 'ContextCommand';
46
+ readonly filepath: string;
47
47
  readonly client: XernerxClientType;
48
48
  constructor(id: string, options: ContextCommandOptions);
49
- exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T>;
49
+ /**
50
+ * @description the execution of the command
51
+ * @param interaction - Interaction event emitted on command
52
+ * @param args - The arguments parsed with the command, if any
53
+ */
54
+ exec(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<any>;
50
55
  }
51
56
  //# sourceMappingURL=XernerxContextCommand.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxContextCommand.d.ts","sourceRoot":"","sources":["../../src/build/XernerxContextCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD,OAAO,EAAE,gCAAgC,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3H,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAExF,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACzC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,SAAwB,WAAW,4BAAC;IACpC,SAAwB,KAAK,4BAAC;IAC9B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,QAAQ,4BAAC;IACjC,SAA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BAAC;IAC9B,SAAwB,QAAQ,EAAE,gBAAgB,CAAC;IACnD,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB;IAgF7D;;;;OAIG;IACU,IAAI,CAAC,WAAW,EAAE,6BAA6B,GAAG,gCAAgC,EAAE,IAAI,EAAE,uBAAuB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAKjK"}
@@ -1,6 +1,7 @@
1
1
  /** @format */
2
2
  import { ContextMenuCommandBuilder } from 'discord.js';
3
3
  import { z } from 'zod';
4
+ import { XernerxLog } from '../main.js';
4
5
  export default class XernerxContextCommand {
5
6
  constructor(id, options) {
6
7
  this.id = id;
@@ -63,6 +64,14 @@ export default class XernerxContextCommand {
63
64
  this.defer = options.defer;
64
65
  this.client = this.client;
65
66
  }
66
- async exec(interaction, args) {}
67
+ /**
68
+ * @description the execution of the command
69
+ * @param interaction - Interaction event emitted on command
70
+ * @param args - The arguments parsed with the command, if any
71
+ */
72
+ async exec(interaction, args) {
73
+ new XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);
74
+ return await this.client.emit('commandError', interaction, `${this.id} doesn't have an execution rule.`, this, this.filetype);
75
+ }
67
76
  }
68
77
  //# sourceMappingURL=XernerxContextCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxContextCommand.js","sourceRoot":"","sources":["../../src/build/XernerxContextCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAkBzC,YAAmB,EAAU,EAAE,OAA8B;QAC5D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,IAAI,GAAG,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,OAAO,CAAC,EAAE,CAAC;YACb,KAAK,EAAE,CAAC;iBACN,MAAM,CAAC;gBACP,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;gBACjC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;gBACrC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;aACjC,CAAC;iBACD,OAAO,CAAC,EAAE,CAAC;SACb,CAAC;aACD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,IAAI,CAAI,WAA6E,EAAE,IAAiD,IAA4B,CAAC;CAClL","sourcesContent":["/** @format */\n\nimport { ContextMenuCommandBuilder } from 'discord.js';\nimport { z } from 'zod';\n\nimport { XernerxMessageContextInteraction, XernerxUserContextInteraction, XernerxClientType } from '../types/extenders.js';\nimport { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';\n\nexport default class XernerxContextCommand {\n\tpublic declare readonly id;\n\tpublic declare readonly data;\n\tpublic declare readonly name;\n\tpublic declare readonly type: 'user' | 'message';\n\tpublic declare readonly description;\n\tpublic declare readonly usage;\n\tpublic declare readonly info;\n\tpublic declare readonly category;\n\tpublic declare readonly cooldown;\n\tpublic declare readonly ignore;\n\tpublic declare readonly strict;\n\tpublic declare readonly permissions;\n\tpublic declare readonly defer;\n\tpublic declare readonly fileType: 'ContextCommand';\n\tpublic declare readonly filePath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: ContextCommandOptions) {\n\t\tthis.id = id;\n\n\t\tthis.data = new ContextMenuCommandBuilder();\n\n\t\tthis.data.setName(options.name);\n\n\t\tthis.data.setNameLocalizations(options.nameLocalizations || null);\n\n\t\tthis.data.setType(options.type === 'user' ? 2 : 3);\n\n\t\tthis.data.setDMPermission(options.permissions?.dm || null);\n\n\t\toptions = z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\ttype: z.enum(['user', 'message']),\n\t\t\t\tdescription: z.string().or(z.null()).default(null),\n\t\t\t\tusage: z.string().or(z.null()).default(null),\n\t\t\t\tinfo: z.string().or(z.null()).default(null),\n\t\t\t\tcategory: z.string().or(z.null()).default(null),\n\t\t\t\tcooldown: z.number().or(z.null()).default(null),\n\t\t\t\tignore: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tstrict: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tpermissions: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\tuser: z.array(z.string()).default([]),\n\t\t\t\t\t\tclient: z.array(z.string()).default([]),\n\t\t\t\t\t\tdm: z.boolean().default(true),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tdefer: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\treply: z.boolean().default(false),\n\t\t\t\t\t\tephemeral: z.boolean().default(false),\n\t\t\t\t\t\tfetch: z.boolean().default(false),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t})\n\t\t\t.parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.type = options.type;\n\n\t\tthis.description = options.description;\n\n\t\tthis.usage = options.usage;\n\n\t\tthis.info = options.info;\n\n\t\tthis.category = options.category;\n\n\t\tthis.cooldown = options.cooldown;\n\n\t\tthis.ignore = options.ignore;\n\n\t\tthis.strict = options.strict;\n\n\t\tthis.permissions = options.permissions;\n\n\t\tthis.defer = options.defer;\n\n\t\tthis.client = this.client;\n\t}\n\n\tpublic async exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T> {}\n}\n"]}
1
+ {"version":3,"file":"XernerxContextCommand.js","sourceRoot":"","sources":["../../src/build/XernerxContextCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAkBzC,YAAmB,EAAU,EAAE,OAA8B;QAC5D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,IAAI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CAAC;QAEhF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,kCAAkC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/H,CAAC;CACD","sourcesContent":["/** @format */\n\nimport { ContextMenuCommandBuilder } from 'discord.js';\nimport { z } from 'zod';\n\nimport { XernerxMessageContextInteraction, XernerxUserContextInteraction, XernerxClientType } from '../types/extenders.js';\nimport { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';\nimport { XernerxLog } from '../main.js';\n\nexport default class XernerxContextCommand {\n\tpublic declare readonly id;\n\tpublic declare readonly data;\n\tpublic declare readonly name;\n\tpublic declare readonly type: 'user' | 'message';\n\tpublic declare readonly description;\n\tpublic declare readonly usage;\n\tpublic declare readonly info;\n\tpublic declare readonly category;\n\tpublic declare readonly cooldown;\n\tpublic declare readonly ignore;\n\tpublic declare readonly strict;\n\tpublic declare readonly permissions;\n\tpublic declare readonly defer;\n\tpublic declare readonly filetype: 'ContextCommand';\n\tpublic declare readonly filepath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: ContextCommandOptions) {\n\t\tthis.id = id;\n\n\t\tthis.data = new ContextMenuCommandBuilder();\n\n\t\tthis.data.setName(options.name);\n\n\t\tthis.data.setNameLocalizations(options.nameLocalizations || null);\n\n\t\tthis.data.setType(options.type === 'user' ? 2 : 3);\n\n\t\tthis.data.setDMPermission(options.permissions?.dm || null);\n\n\t\toptions = z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\ttype: z.enum(['user', 'message']),\n\t\t\t\tdescription: z.string().or(z.null()).default(null),\n\t\t\t\tusage: z.string().or(z.null()).default(null),\n\t\t\t\tinfo: z.string().or(z.null()).default(null),\n\t\t\t\tcategory: z.string().or(z.null()).default(null),\n\t\t\t\tcooldown: z.number().or(z.null()).default(null),\n\t\t\t\tignore: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tstrict: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tpermissions: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\tuser: z.array(z.string()).default([]),\n\t\t\t\t\t\tclient: z.array(z.string()).default([]),\n\t\t\t\t\t\tdm: z.boolean().default(true),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tdefer: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\treply: z.boolean().default(false),\n\t\t\t\t\t\tephemeral: z.boolean().default(false),\n\t\t\t\t\t\tfetch: z.boolean().default(false),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t})\n\t\t\t.parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.type = options.type;\n\n\t\tthis.description = options.description;\n\n\t\tthis.usage = options.usage;\n\n\t\tthis.info = options.info;\n\n\t\tthis.category = options.category;\n\n\t\tthis.cooldown = options.cooldown;\n\n\t\tthis.ignore = options.ignore;\n\n\t\tthis.strict = options.strict;\n\n\t\tthis.permissions = options.permissions;\n\n\t\tthis.defer = options.defer;\n\n\t\tthis.client = this.client;\n\t}\n\n\t/**\n\t * @description the execution of the command\n\t * @param interaction - Interaction event emitted on command\n\t * @param args - The arguments parsed with the command, if any\n\t */\n\tpublic async exec(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<any> {\n\t\tnew XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);\n\n\t\treturn await this.client.emit('commandError', interaction, `${this.id} doesn't have an execution rule.`, this, this.filetype);\n\t}\n}\n"]}
@@ -13,14 +13,14 @@ export default class XernerxEvent {
13
13
  readonly emitter?: 'client' | 'process' | string;
14
14
  readonly type?: 'discord' | string;
15
15
  readonly once?: boolean;
16
- readonly fileType: 'Event';
17
- readonly filePath: string;
16
+ readonly filetype: 'Event';
17
+ readonly filepath: string;
18
18
  readonly client: XernerxClientType;
19
19
  constructor(id: string, options: XernerxEventOptions);
20
20
  /**
21
21
  * @description run your custom event here.
22
- * TODO - update description
22
+ * @param any - there can be all kinds of parameters on events.
23
23
  */
24
- run(...args: any): Promise<void>;
24
+ run(...args: any): Promise<any>;
25
25
  }
26
26
  //# sourceMappingURL=XernerxEvent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxEvent.d.ts","sourceRoot":"","sources":["../../src/build/XernerxEvent.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAChC,SAAwB,EAAE,EAAE,MAAM,CAAC;IACnC,SAAwB,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACxD,SAAwB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAChE,SAAwB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAClD,SAAwB,IAAI,CAAC,EAAE,OAAO,CAAC;IACvC,SAAwB,QAAQ,EAAE,OAAO,CAAC;IAC1C,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;IAoB3D;;;OAGG;IACU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG;CAC7B"}
1
+ {"version":3,"file":"XernerxEvent.d.ts","sourceRoot":"","sources":["../../src/build/XernerxEvent.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAc,MAAM,YAAY,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAChC,SAAwB,EAAE,EAAE,MAAM,CAAC;IACnC,SAAwB,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACxD,SAAwB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAChE,SAAwB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAClD,SAAwB,IAAI,CAAC,EAAE,OAAO,CAAC;IACvC,SAAwB,QAAQ,EAAE,OAAO,CAAC;IAC1C,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;IAoB3D;;;OAGG;IACU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAG5C"}
@@ -1,5 +1,6 @@
1
1
  /** @format */
2
2
  import { z } from 'zod';
3
+ import { XernerxLog } from '../main.js';
3
4
  /**
4
5
  * @description - The event builder for events.
5
6
  * @param {String} id - The unique ID of the event.
@@ -22,8 +23,10 @@ export default class XernerxEvent {
22
23
  }
23
24
  /**
24
25
  * @description run your custom event here.
25
- * TODO - update description
26
+ * @param any - there can be all kinds of parameters on events.
26
27
  */
27
- async run(...args) {}
28
+ async run(...args) {
29
+ return new XernerxLog(this.client).error(`${this.id} doesn't have a run rule.`);
30
+ }
28
31
  }
29
32
  //# sourceMappingURL=XernerxEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxEvent.js","sourceRoot":"","sources":["../../src/build/XernerxEvent.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAUhC,YAAmB,EAAU,EAAE,OAA4B;QAC1D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACR,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SAC5B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC;QAE3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;QAEtC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC;QAElC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD;;;OAGG;IACI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAS,IAAG,CAAC;CACjC","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\n\nimport { XernerxEventOptions } from '../types/interfaces.js';\nimport { XernerxEventType } from '../types/types.js';\nimport { XernerxClientType } from '../main.js';\n\n/**\n * @description - The event builder for events.\n * @param {String} id - The unique ID of the event.\n * @param {EventOptions} options - The event options.\n */\nexport default class XernerxEvent {\n\tpublic declare readonly id: string;\n\tpublic declare readonly name: XernerxEventType | string;\n\tpublic declare readonly emitter?: 'client' | 'process' | string;\n\tpublic declare readonly type?: 'discord' | string;\n\tpublic declare readonly once?: boolean;\n\tpublic declare readonly fileType: 'Event';\n\tpublic declare readonly filePath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: XernerxEventOptions) {\n\t\tthis.id = id;\n\n\t\tz.object({\n\t\t\tname: z.string(),\n\t\t\temitter: z.string().optional(),\n\t\t\ttype: z.string().optional(),\n\t\t\tonce: z.boolean().optional(),\n\t\t}).parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.emitter = options.emitter || 'client';\n\n\t\tthis.type = options.type || 'discord';\n\n\t\tthis.once = options.once || false;\n\n\t\tthis.client = this.client;\n\t}\n\t/**\n\t * @description run your custom event here.\n\t * TODO - update description\n\t */\n\tpublic async run(...args: any) {}\n}\n"]}
1
+ {"version":3,"file":"XernerxEvent.js","sourceRoot":"","sources":["../../src/build/XernerxEvent.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAqB,UAAU,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAUhC,YAAmB,EAAU,EAAE,OAA4B;QAC1D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACR,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SAC5B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC;QAE3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;QAEtC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC;QAElC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD;;;OAGG;IACI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAS;QAC5B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACjF,CAAC;CACD","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\n\nimport { XernerxEventOptions } from '../types/interfaces.js';\nimport { XernerxEventType } from '../types/types.js';\nimport { XernerxClientType, XernerxLog } from '../main.js';\n\n/**\n * @description - The event builder for events.\n * @param {String} id - The unique ID of the event.\n * @param {EventOptions} options - The event options.\n */\nexport default class XernerxEvent {\n\tpublic declare readonly id: string;\n\tpublic declare readonly name: XernerxEventType | string;\n\tpublic declare readonly emitter?: 'client' | 'process' | string;\n\tpublic declare readonly type?: 'discord' | string;\n\tpublic declare readonly once?: boolean;\n\tpublic declare readonly filetype: 'Event';\n\tpublic declare readonly filepath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: XernerxEventOptions) {\n\t\tthis.id = id;\n\n\t\tz.object({\n\t\t\tname: z.string(),\n\t\t\temitter: z.string().optional(),\n\t\t\ttype: z.string().optional(),\n\t\t\tonce: z.boolean().optional(),\n\t\t}).parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.emitter = options.emitter || 'client';\n\n\t\tthis.type = options.type || 'discord';\n\n\t\tthis.once = options.once || false;\n\n\t\tthis.client = this.client;\n\t}\n\t/**\n\t * @description run your custom event here.\n\t * @param any - there can be all kinds of parameters on events.\n\t */\n\tpublic async run(...args: any): Promise<any> {\n\t\treturn new XernerxLog(this.client).error(`${this.id} doesn't have a run rule.`);\n\t}\n}\n"]}
@@ -11,19 +11,26 @@ export default class XernerxInhibitor {
11
11
  readonly id: string;
12
12
  readonly name: string;
13
13
  readonly type: InhibitorType;
14
- readonly fileType: 'Inhibitor';
15
- readonly filePath: string;
14
+ readonly filetype: 'Inhibitor';
15
+ readonly filepath: string;
16
16
  readonly client: XernerxClientType;
17
17
  constructor(id: string, options: XernerxInhibitorOptions);
18
+ /**
19
+ * @description The check rule
20
+ * @param interaction - The interaction with the inhibitor, can be message and interaction
21
+ * @param args - The arguments parsed with this command
22
+ */
18
23
  check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(
19
24
  interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
20
- args: T extends XernerxMessage
21
- ? MessageCommandArguments
22
- : T extends XernerxSlashInteraction
23
- ? SlashCommandArguments
24
- : T extends XernerxUserContextInteraction
25
- ? XernerxUserContextInteraction
26
- : XernerxMessageContextInteraction | null
27
- ): Promise<void | any | T>;
25
+ args:
26
+ | (T extends XernerxMessage
27
+ ? MessageCommandArguments
28
+ : T extends XernerxSlashInteraction
29
+ ? SlashCommandArguments
30
+ : T extends XernerxUserContextInteraction
31
+ ? XernerxUserContextInteraction
32
+ : XernerxMessageContextInteraction)
33
+ | null
34
+ ): Promise<any>;
28
35
  }
29
36
  //# sourceMappingURL=XernerxInhibitor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxInhibitor.d.ts","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,w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AAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAGpK;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACpC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,IAAI,EAAE,aAAa,CAAC;IAC5C,SAAwB,QAAQ,EAAE,WAAW,CAAC;IAC9C,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAe/D;;;;OAIG;IACU,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC,EAC3J,WAAW,EAAE,cAAc,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC,EAC5I,IAAI,EACD,CAAC,CAAC,SAAS,cAAc,GACvB,uBAAuB,GACvB,CAAC,SAAS,uBAAuB,GACjC,qBAAqB,GACrB,CAAC,SAAS,6BAA6B,GACvC,6BAA6B,GAC7B,gCAAgC,CAAC,GACnC,IAAI,GACL,OAAO,CAAC,GAAG,CAAC;CAKf"}
@@ -1,5 +1,6 @@
1
1
  /** @format */
2
2
  import { z } from 'zod';
3
+ import { XernerxLog } from '../main.js';
3
4
  /**
4
5
  * @description - The inhibitor builder for inhibitors.
5
6
  * @param {String} id - The unique ID of the inhibitor.
@@ -16,6 +17,14 @@ export default class XernerxInhibitor {
16
17
  this.type = options.type;
17
18
  this.client = this.client;
18
19
  }
19
- async check(interaction, args) {}
20
+ /**
21
+ * @description The check rule
22
+ * @param interaction - The interaction with the inhibitor, can be message and interaction
23
+ * @param args - The arguments parsed with this command
24
+ */
25
+ async check(interaction, args) {
26
+ new XernerxLog(this.client).error(`${this.id} doesn't have a check rule.`);
27
+ return await this.client.emit('commandError', interaction, `${this.name} doesn't have a check rule.`, this, this.filetype);
28
+ }
20
29
  }
21
30
  //# sourceMappingURL=XernerxInhibitor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxInhibitor.js","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAQpC,YAAmB,EAAU,EAAE,OAAgC;QAC9D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACR,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,KAAK,CACjB,WAA4I,EAC5I,IAM0C,IACf,CAAC;CAC7B","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\n\nimport { XernerxInhibitorOptions, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';\nimport { InhibitorType, XernerxInteraction } from '../types/types.js';\nimport { XernerxClientType, XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\n\n/**\n * @description - The inhibitor builder for inhibitors.\n * @param {String} id - The unique ID of the inhibitor.\n * @param {InhibitorOptions} options - The inhibitor options.\n */\nexport default class XernerxInhibitor {\n\tpublic declare readonly id;\n\tpublic declare readonly name;\n\tpublic declare readonly type: InhibitorType;\n\tpublic declare readonly fileType: 'Inhibitor';\n\tpublic declare readonly filePath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: XernerxInhibitorOptions) {\n\t\tthis.id = id;\n\n\t\tz.object({\n\t\t\tname: z.string(),\n\t\t\ttype: z.string(),\n\t\t}).parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.type = options.type;\n\n\t\tthis.client = this.client;\n\t}\n\n\tpublic async check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(\n\t\tinteraction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\targs: T extends XernerxMessage\n\t\t\t? MessageCommandArguments\n\t\t\t: T extends XernerxSlashInteraction\n\t\t\t? SlashCommandArguments\n\t\t\t: T extends XernerxUserContextInteraction\n\t\t\t? XernerxUserContextInteraction\n\t\t\t: XernerxMessageContextInteraction | null\n\t): Promise<void | any | T> {}\n}\n"]}
1
+ {"version":3,"file":"XernerxInhibitor.js","sourceRoot":"","sources":["../../src/build/XernerxInhibitor.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAQpC,YAAmB,EAAU,EAAE,OAAgC;QAC9D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC,MAAM,CAAC;YACR,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CACjB,WAA4I,EAC5I,IAQO;QAEP,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,EAAE,6BAA6B,CAAC,CAAC;QAE3E,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,6BAA6B,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5H,CAAC;CACD","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\n\nimport { XernerxInhibitorOptions, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';\nimport { InhibitorType, XernerxInteraction } from '../types/types.js';\nimport { XernerxClientType, XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\nimport { XernerxLog } from '../main.js';\n\n/**\n * @description - The inhibitor builder for inhibitors.\n * @param {String} id - The unique ID of the inhibitor.\n * @param {InhibitorOptions} options - The inhibitor options.\n */\nexport default class XernerxInhibitor {\n\tpublic declare readonly id;\n\tpublic declare readonly name;\n\tpublic declare readonly type: InhibitorType;\n\tpublic declare readonly filetype: 'Inhibitor';\n\tpublic declare readonly filepath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: XernerxInhibitorOptions) {\n\t\tthis.id = id;\n\n\t\tz.object({\n\t\t\tname: z.string(),\n\t\t\ttype: z.string(),\n\t\t}).parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.type = options.type;\n\n\t\tthis.client = this.client;\n\t}\n\n\t/**\n\t * @description The check rule\n\t * @param interaction - The interaction with the inhibitor, can be message and interaction\n\t * @param args - The arguments parsed with this command\n\t */\n\tpublic async check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(\n\t\tinteraction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\targs:\n\t\t\t| (T extends XernerxMessage\n\t\t\t\t\t? MessageCommandArguments\n\t\t\t\t\t: T extends XernerxSlashInteraction\n\t\t\t\t\t? SlashCommandArguments\n\t\t\t\t\t: T extends XernerxUserContextInteraction\n\t\t\t\t\t? XernerxUserContextInteraction\n\t\t\t\t\t: XernerxMessageContextInteraction)\n\t\t\t| null\n\t): Promise<any> {\n\t\tnew XernerxLog(this.client).error(`${this.id} doesn't have a check rule.`);\n\n\t\treturn await this.client.emit('commandError', interaction, `${this.name} doesn't have a check rule.`, this, this.filetype);\n\t}\n}\n"]}
@@ -11,8 +11,8 @@ export default class XernerxMessageCommand {
11
11
  readonly usage: string | null | undefined;
12
12
  readonly info: string | null | undefined;
13
13
  readonly separator: string | undefined;
14
- readonly args: import('../types/interfaces.js').MessageCommandArgumentOptions[] | undefined;
15
- readonly flags: import('../types/interfaces.js').MessageCommandFlagOptions[] | undefined;
14
+ readonly args: import('../main.js').MessageCommandArgumentOptions[] | undefined;
15
+ readonly flags: import('../main.js').MessageCommandFlagOptions[] | undefined;
16
16
  readonly category: string | null | undefined;
17
17
  readonly cooldown: number | null | undefined;
18
18
  readonly ignore:
@@ -38,11 +38,21 @@ export default class XernerxMessageCommand {
38
38
  dm?: boolean | undefined;
39
39
  }
40
40
  | undefined;
41
- readonly fileType: 'MessageCommand';
42
- readonly filePath: string;
41
+ readonly filetype: 'MessageCommand';
42
+ readonly filepath: string;
43
43
  readonly client: XernerxClientType;
44
44
  constructor(id: string, options: MessageCommandOptions);
45
- conditions<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
46
- exec<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
45
+ /**
46
+ * @description Checks for conditions before running the command
47
+ * @param message - The message event emitted on this command
48
+ * @param options - The args and flags parsed on this command
49
+ */
50
+ conditions(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any>;
51
+ /**
52
+ * @description Runs the execution rule
53
+ * @param message - The message event emitted on this command
54
+ * @param options - The args and flags parsed on this command
55
+ */
56
+ exec(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any>;
47
57
  }
48
58
  //# sourceMappingURL=XernerxMessageCommand.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxMessageCommand.d.ts","sourceRoot":"","sources":["../../src/build/XernerxMessageCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAExF,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACzC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,OAAO,uBAAC;IAChC,SAAwB,KAAK,qBAAC;IAC9B,SAAwB,MAAM,gCAAC;IAC/B,SAAwB,WAAW,4BAAC;IACpC,SAAwB,KAAK,4BAAC;IAC9B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,SAAS,qBAAC;IAClC,SAAwB,IAAI,+EAAC;IAC7B,SAAwB,KAAK,2EAAC;IAC9B,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,WAAW;;;;kBAAC;IACpC,SAAwB,QAAQ,EAAE,gBAAgB,CAAC;IACnD,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB;IAwEhD,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,G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AI,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC;CAKlG"}
@@ -1,5 +1,6 @@
1
1
  /** @format */
2
2
  import { z } from 'zod';
3
+ import { XernerxLog } from '../main.js';
3
4
  export default class XernerxMessageCommand {
4
5
  constructor(id, options) {
5
6
  this.id = id;
@@ -55,7 +56,20 @@ export default class XernerxMessageCommand {
55
56
  this.permissions = options.permissions;
56
57
  this.client = this.client;
57
58
  }
59
+ /**
60
+ * @description Checks for conditions before running the command
61
+ * @param message - The message event emitted on this command
62
+ * @param options - The args and flags parsed on this command
63
+ */
58
64
  async conditions(message, { args, flags }) {}
59
- async exec(message, { args, flags }) {}
65
+ /**
66
+ * @description Runs the execution rule
67
+ * @param message - The message event emitted on this command
68
+ * @param options - The args and flags parsed on this command
69
+ */
70
+ async exec(message, { args, flags }) {
71
+ new XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);
72
+ return await this.client.emit('commandError', message, `${this.id} doesn't have an execution rule.`, this, this.filetype);
73
+ }
60
74
  }
61
75
  //# sourceMappingURL=XernerxMessageCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxMessageCommand.js","sourceRoot":"","sources":["../../src/build/XernerxMessageCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAqBzC,YAAmB,EAAU,EAAE,OAA8B;QAC5D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,OAAO,GAAG,CAAC;aACT,MAAM,CAAC;YACP,IAAI,EAA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AI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEnC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,UAAU,CAAI,OAAuB,EAAE,EAAE,IAAI,EAAE,KAAK,EAA2B,IAA4B,CAAC;IAElH,KAAK,CAAC,IAAI,CAAI,OAAuB,EAAE,EAAE,IAAI,EAAE,KAAK,EAA2B,IAA4B,CAAC;CACnH","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\nimport { XernerxClientType, XernerxMessage } from '../types/extenders.js';\nimport { MessageCommandArguments, MessageCommandOptions } from '../types/interfaces.js';\n\nexport default class XernerxMessageCommand {\n\tpublic declare readonly id;\n\tpublic declare readonly name;\n\tpublic declare readonly aliases;\n\tpublic declare readonly regex;\n\tpublic declare readonly prefix;\n\tpublic declare readonly description;\n\tpublic declare readonly usage;\n\tpublic declare readonly info;\n\tpublic declare readonly separator;\n\tpublic declare readonly args;\n\tpublic declare readonly flags;\n\tpublic declare readonly category;\n\tpublic declare readonly cooldown;\n\tpublic declare readonly ignore;\n\tpublic declare readonly strict;\n\tpublic declare readonly permissions;\n\tpublic declare readonly fileType: 'MessageCommand';\n\tpublic declare readonly filePath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: MessageCommandOptions) {\n\t\tthis.id = id;\n\n\t\tthis.regex = options.regex;\n\n\t\tthis.args = options.args;\n\n\t\tthis.flags = options.flags;\n\n\t\toptions = z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\taliases: z.array(z.string()).default([]),\n\t\t\t\tdescription: z.string().or(z.null()).default(null),\n\t\t\t\tusage: z.string().or(z.null()).default(null),\n\t\t\t\tinfo: z.string().or(z.null()).default(null),\n\t\t\t\tcategory: z.string().or(z.null()).default(null),\n\t\t\t\tcooldown: z.number().or(z.null()).default(null),\n\t\t\t\tprefix: z.array(z.string()).or(z.string()).default([]),\n\t\t\t\tignore: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tstrict: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tpermissions: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\tuser: z.array(z.string()).default([]),\n\t\t\t\t\t\tclient: z.array(z.string()).default([]),\n\t\t\t\t\t\tdm: z.boolean().default(true),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t})\n\t\t\t.parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.aliases = options.aliases;\n\n\t\tthis.prefix = options.prefix;\n\n\t\tthis.description = options.description;\n\n\t\tthis.usage = options.usage;\n\n\t\tthis.info = options.info;\n\n\t\tthis.category = options.category;\n\n\t\tthis.cooldown = options.cooldown;\n\n\t\tthis.ignore = options.ignore;\n\n\t\tthis.strict = options.strict;\n\n\t\tthis.separator = options.separator;\n\n\t\tthis.permissions = options.permissions;\n\n\t\tthis.client = this.client;\n\t}\n\n\tpublic async conditions<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T> {}\n\n\tpublic async exec<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T> {}\n}\n"]}
1
+ {"version":3,"file":"XernerxMessageCommand.js","sourceRoot":"","sources":["../../src/build/XernerxMessageCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAqBzC,YAAmB,EAAU,EAAE,OAA8B;QAC5D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,OAAO,GAAG,CAAC;aACT,MAAM,CAAC;YACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;YAClD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;YAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO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AI,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU,CAAC,OAAuB,EAAE,EAAE,IAAI,EAAE,KAAK,EAA2B,IAAiB,CAAC;IAE3G;;;;OAIG;IACI,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,EAAE,IAAI,EAAE,KAAK,EAA2B;QAClF,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,EAAE,kCAAkC,CAAC,CAAC;QAEhF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,kCAAkC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3H,CAAC;CACD","sourcesContent":["/** @format */\n\nimport { z } from 'zod';\nimport { XernerxClientType, XernerxMessage } from '../types/extenders.js';\nimport { MessageCommandArguments, MessageCommandOptions } from '../types/interfaces.js';\nimport { XernerxLog } from '../main.js';\n\nexport default class XernerxMessageCommand {\n\tpublic declare readonly id;\n\tpublic declare readonly name;\n\tpublic declare readonly aliases;\n\tpublic declare readonly regex;\n\tpublic declare readonly prefix;\n\tpublic declare readonly description;\n\tpublic declare readonly usage;\n\tpublic declare readonly info;\n\tpublic declare readonly separator;\n\tpublic declare readonly args;\n\tpublic declare readonly flags;\n\tpublic declare readonly category;\n\tpublic declare readonly cooldown;\n\tpublic declare readonly ignore;\n\tpublic declare readonly strict;\n\tpublic declare readonly permissions;\n\tpublic declare readonly filetype: 'MessageCommand';\n\tpublic declare readonly filepath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: MessageCommandOptions) {\n\t\tthis.id = id;\n\n\t\tthis.regex = options.regex;\n\n\t\tthis.args = options.args;\n\n\t\tthis.flags = options.flags;\n\n\t\toptions = z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\taliases: z.array(z.string()).default([]),\n\t\t\t\tdescription: z.string().or(z.null()).default(null),\n\t\t\t\tusage: z.string().or(z.null()).default(null),\n\t\t\t\tinfo: z.string().or(z.null()).default(null),\n\t\t\t\tcategory: z.string().or(z.null()).default(null),\n\t\t\t\tcooldown: z.number().or(z.null()).default(null),\n\t\t\t\tprefix: z.array(z.string()).or(z.string()).default([]),\n\t\t\t\tignore: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tstrict: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tpermissions: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\tuser: z.array(z.string()).default([]),\n\t\t\t\t\t\tclient: z.array(z.string()).default([]),\n\t\t\t\t\t\tdm: z.boolean().default(true),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t})\n\t\t\t.parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.aliases = options.aliases;\n\n\t\tthis.prefix = options.prefix;\n\n\t\tthis.description = options.description;\n\n\t\tthis.usage = options.usage;\n\n\t\tthis.info = options.info;\n\n\t\tthis.category = options.category;\n\n\t\tthis.cooldown = options.cooldown;\n\n\t\tthis.ignore = options.ignore;\n\n\t\tthis.strict = options.strict;\n\n\t\tthis.separator = options.separator;\n\n\t\tthis.permissions = options.permissions;\n\n\t\tthis.client = this.client;\n\t}\n\n\t/**\n\t * @description Checks for conditions before running the command\n\t * @param message - The message event emitted on this command\n\t * @param options - The args and flags parsed on this command\n\t */\n\tpublic async conditions(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any> {}\n\n\t/**\n\t * @description Runs the execution rule\n\t * @param message - The message event emitted on this command\n\t * @param options - The args and flags parsed on this command\n\t */\n\tpublic async exec(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any> {\n\t\tnew XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);\n\n\t\treturn await this.client.emit('commandError', message, `${this.id} doesn't have an execution rule.`, this, this.filetype);\n\t}\n}\n"]}
@@ -30,8 +30,8 @@ export default class XernerxSlashCommand {
30
30
  | undefined;
31
31
  readonly permissions:
32
32
  | {
33
- user?: string[] | import('../types/types.js').PermissionNames[] | undefined;
34
- client?: string[] | import('../types/types.js').PermissionNames[] | undefined;
33
+ user?: string[] | import('../main.js').PermissionNames[] | undefined;
34
+ client?: string[] | import('../main.js').PermissionNames[] | undefined;
35
35
  dm?: boolean | undefined;
36
36
  }
37
37
  | undefined;
@@ -42,15 +42,31 @@ export default class XernerxSlashCommand {
42
42
  fetchReply?: boolean | undefined;
43
43
  }
44
44
  | undefined;
45
- readonly fileType: 'SlashCommand';
46
- readonly filePath: string;
45
+ readonly filetype: 'SlashCommand';
46
+ readonly filepath: string;
47
47
  readonly client: XernerxClientType;
48
48
  constructor(id: string, options: SlashCommandOptions);
49
+ /**
50
+ * @description autocomplete let's you add choices to string option arguments
51
+ * @param interaction - The interaction event emitted on this command
52
+ * @param focused - The command option that is in focus
53
+ * @param options - The full list of options on the command
54
+ */
49
55
  autocomplete<T>(interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, focused: T, options: T[]): Promise<void | any | T>;
56
+ /**
57
+ * @description Checks for conditions before running the command
58
+ * @param interaction - The interaction event emitted on this command
59
+ * @param options - The args, group and subcommand parsed on this command
60
+ */
50
61
  conditions<T>(
51
62
  interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
52
63
  { args, subcommand, group }: SlashCommandArguments
53
64
  ): Promise<void | any | T>;
65
+ /**
66
+ * @description Runs the execution rule
67
+ * @param interaction - The interaction event emitted on this command
68
+ * @param options - The args, group and subcommand parsed on this command
69
+ */
54
70
  exec<T>(
55
71
  interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
56
72
  { args, subcommand, group }: SlashCommandArguments
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxSlashCommand.d.ts","sourceRoot":"","sources":["../../src/build/XernerxSlashCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,OAAwG,MAAM,YAAY,CAAC;AAElI,OAAO,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACpJ,OAAO,EAA+B,qBAAqB,EAA4B,mBAAmB,EAAiC,MAAM,wBAAwB,CAAC;AAC1K,OAAO,EAAgD,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAErG,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACvC,SAAwB,EAAE,SAAC;IAC3B,SAAwB,IAAI,8BAAC;IAC7B,SAAwB,IAAI,SAAC;IAC7B,SAAwB,WAAW,SAAC;IACpC,SAAwB,KAAK,4BAAC;IAC9B,SAAwB,IAAI,4BAAC;IAC7B,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,QAAQ,4BAAC;IACjC,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,MAAM;;;;;kBAAC;IAC/B,SAAwB,WAAW;;;;kBAAC;IACpC,SAAwB,KAAK;;;;kBAAC;IAC9B,SAAwB,QAAQ,EAAE,cAAc,CAAC;IACjD,SAAwB,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAwB,MAAM,EAAE,iBAAiB,CAAC;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;IA4F9C,YAAY,CAAC,CAAC,EAC1B,WA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ashCommandSubcommandGroupBuilder } from 'discord.js';
3
3
  import { z } from 'zod';
4
+ import { XernerxLog } from '../main.js';
4
5
  export default class XernerxSlashCommand {
5
6
  constructor(id, options) {
6
7
  this.id = id;
@@ -72,9 +73,28 @@ export default class XernerxSlashCommand {
72
73
  this.defer = options.defer;
73
74
  this.client = this.client;
74
75
  }
76
+ /**
77
+ * @description autocomplete let's you add choices to string option arguments
78
+ * @param interaction - The interaction event emitted on this command
79
+ * @param focused - The command option that is in focus
80
+ * @param options - The full list of options on the command
81
+ */
75
82
  async autocomplete(interaction, focused, options) {}
83
+ /**
84
+ * @description Checks for conditions before running the command
85
+ * @param interaction - The interaction event emitted on this command
86
+ * @param options - The args, group and subcommand parsed on this command
87
+ */
76
88
  async conditions(interaction, { args, subcommand, group }) {}
77
- async exec(interaction, { args, subcommand, group }) {}
89
+ /**
90
+ * @description Runs the execution rule
91
+ * @param interaction - The interaction event emitted on this command
92
+ * @param options - The args, group and subcommand parsed on this command
93
+ */
94
+ async exec(interaction, { args, subcommand, group }) {
95
+ new XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);
96
+ return await this.client.emit('commandError', interaction, `${this.id} doesn't have an execution rule.`, this, this.filetype);
97
+ }
78
98
  addArguments(command, args) {
79
99
  for (const argument of args) {
80
100
  let slashCommandArgumentType = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxSlashCommand.js","sourceRoot":"","sources":["../../src/build/XernerxSlashCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,OAAO,EAAE,EAA4B,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAClI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAiBvC,YAAmB,EAAU,EAAE,OAA4B;QAC1D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI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kBAAkB,CAAC,eAAe,CAAC,CAAC;SAC9C;IACF,CAAC;CACD","sourcesContent":["/** @format */\n\nimport Discord, { SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from 'discord.js';\nimport { z } from 'zod';\nimport { XernerxClientType, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\nimport { SlashCommandArgumentOptions, SlashCommandArguments, SlashCommandGroupOptions, SlashCommandOptions, SlashCommandSubcommandOptions } from '../types/interfaces.js';\nimport { SlashCommandArgumentType, SlashCommandOption, XernerxInteraction } from '../types/types.js';\n\nexport default class XernerxSlashCommand {\n\tpublic declare readonly id;\n\tpublic declare readonly data;\n\tpublic declare readonly name;\n\tpublic declare readonly description;\n\tpublic declare readonly usage;\n\tpublic declare readonly info;\n\tpublic declare readonly category;\n\tpublic declare readonly cooldown;\n\tpublic declare readonly ignore;\n\tpublic declare readonly strict;\n\tpublic declare readonly permissions;\n\tpublic declare readonly defer;\n\tpublic declare readonly fileType: 'SlashCommand';\n\tpublic declare readonly filePath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: SlashCommandOptions) {\n\t\tthis.id = id;\n\n\t\tthis.data = new Discord.SlashCommandBuilder();\n\n\t\tthis.data.setName(options.name);\n\n\t\tthis.data.setNameLocalizations(options.nameLocalizations || null);\n\n\t\tthis.data.setDescription(options.description);\n\n\t\tthis.data.setDescriptionLocalizations(options.descriptionLocalizations || null);\n\n\t\tthis.data.setDMPermission(options.permissions?.dm || null);\n\n\t\tif (options.args && options?.args?.length > 0) {\n\t\t\tthis.addArguments(this.data, options.args);\n\t\t}\n\n\t\tif (options.subcommands && options?.subcommands?.length > 0) {\n\t\t\tthis.addSubcommands(this.data, options.subcommands);\n\t\t}\n\n\t\tif (options.groups && options?.groups?.length > 0) {\n\t\t\tthis.addSubcommandGroups(options.groups);\n\t\t}\n\n\t\toptions = z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\tdescription: z.string(),\n\t\t\t\tusage: z.string().or(z.null()).default(null),\n\t\t\t\tinfo: z.string().or(z.null()).default(null),\n\t\t\t\tcategory: z.string().or(z.null()).default(null),\n\t\t\t\tnumber: z.number().or(z.null()).default(null),\n\t\t\t\tchannelType: z.array(z.number()).or(z.null()).default(null),\n\t\t\t\tignore: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tstrict: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tpermissions: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\tuser: z.array(z.string()).default([]),\n\t\t\t\t\t\tclient: z.array(z.string()).default([]),\n\t\t\t\t\t\tdm: z.boolean().default(true),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tdefer: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\treply: z.boolean().default(false),\n\t\t\t\t\t\tephemeral: z.boolean().default(false),\n\t\t\t\t\t\tfetch: z.boolean().default(false),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t})\n\t\t\t.parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.description = options.description;\n\n\t\tthis.usage = options.usage;\n\n\t\tthis.info = options.info;\n\n\t\tthis.category = options.category;\n\n\t\tthis.cooldown = options.cooldown;\n\n\t\tthis.ignore = options.ignore;\n\n\t\tthis.strict = options.strict;\n\n\t\tthis.permissions = options.permissions;\n\n\t\tthis.defer = options.defer;\n\n\t\tthis.client = this.client;\n\t}\n\n\tpublic async autocomplete<T>(\n\t\tinteraction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\tfocused: T,\n\t\toptions: T[]\n\t): Promise<void | any | T> {}\n\n\tpublic async conditions<T>(\n\t\tinteraction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\t{ args, subcommand, group }: SlashCommandArguments\n\t): Promise<void | any | T> {}\n\n\tpublic async exec<T>(\n\t\tinteraction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\t{ args, subcommand, group }: SlashCommandArguments\n\t): Promise<void | any | T> {}\n\n\tprivate addArguments(command: Discord.SlashCommandBuilder | SlashCommandSubcommandBuilder, args: Array<SlashCommandArgumentOptions>) {\n\t\tfor (const argument of args) {\n\t\t\tlet slashCommandArgumentType: SlashCommandArgumentType | string = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;\n\n\t\t\t(command[`add${slashCommandArgumentType as UpperCasedSlashCommandArgumentOptions}Option`] as Function)((option: SlashCommandOption) => {\n\t\t\t\toption\n\t\t\t\t\t.setName(argument.name)\n\t\t\t\t\t.setDescription(argument.description)\n\t\t\t\t\t.setRequired(argument.required || false);\n\n\t\t\t\tif (slashCommandArgumentType === 'String') {\n\t\t\t\t\tif (argument.choices)\n\t\t\t\t\t\t(option as SlashCommandStringOption).setChoices(\n\t\t\t\t\t\t\t...(argument.choices.map((choices) => {\n\t\t\t\t\t\t\t\treturn { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };\n\t\t\t\t\t\t\t}) as Array<any>)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t(option as SlashCommandStringOption).setAutocomplete(argument.autocomplete || false);\n\t\t\t\t}\n\n\t\t\t\treturn option;\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate addSubcommands(method: Discord.SlashCommandBuilder | SlashCommandSubcommandGroupBuilder, subcommands: Array<SlashCommandSubcommandOptions>) {\n\t\tfor (const subcommand of subcommands) {\n\t\t\tlet sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);\n\n\t\t\tif (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);\n\n\t\t\tmethod.addSubcommand(sub);\n\t\t}\n\t}\n\n\tprivate addSubcommandGroups(groups: Array<SlashCommandGroupOptions>) {\n\t\tfor (const group of groups) {\n\t\t\tlet subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);\n\n\t\t\tif (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);\n\n\t\t\tthis.data.addSubcommandGroup(subcommandGroup);\n\t\t}\n\t}\n}\n\ntype UpperCasedSlashCommandArgumentOptions = 'Attachment' | 'Boolean' | 'Channel' | 'Integer' | 'Mentionable' | 'Number' | 'Role' | 'String' | 'User';\n"]}
1
+ {"version":3,"file":"XernerxSlashCommand.js","sourceRoot":"","sources":["../../src/build/XernerxSlashCommand.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,OAAO,EAAE,EAA4B,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAClI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAiBvC,YAAmB,EAAU,EAAE,OAA4B;QAC1D,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAE9C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,IAAI,IAAI,CA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gBAAE,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;YAE3F,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;SAC9C;IACF,CAAC;CACD","sourcesContent":["/** @format */\n\nimport Discord, { SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from 'discord.js';\nimport { z } from 'zod';\nimport { XernerxClientType, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';\nimport { SlashCommandArgumentOptions, SlashCommandArguments, SlashCommandGroupOptions, SlashCommandOptions, SlashCommandSubcommandOptions } from '../types/interfaces.js';\nimport { SlashCommandArgumentType, SlashCommandOption, XernerxInteraction } from '../types/types.js';\nimport { XernerxLog } from '../main.js';\n\nexport default class XernerxSlashCommand {\n\tpublic declare readonly id;\n\tpublic declare readonly data;\n\tpublic declare readonly name;\n\tpublic declare readonly description;\n\tpublic declare readonly usage;\n\tpublic declare readonly info;\n\tpublic declare readonly category;\n\tpublic declare readonly cooldown;\n\tpublic declare readonly ignore;\n\tpublic declare readonly strict;\n\tpublic declare readonly permissions;\n\tpublic declare readonly defer;\n\tpublic declare readonly filetype: 'SlashCommand';\n\tpublic declare readonly filepath: string;\n\tpublic declare readonly client: XernerxClientType;\n\n\tpublic constructor(id: string, options: SlashCommandOptions) {\n\t\tthis.id = id;\n\n\t\tthis.data = new Discord.SlashCommandBuilder();\n\n\t\tthis.data.setName(options.name);\n\n\t\tthis.data.setNameLocalizations(options.nameLocalizations || null);\n\n\t\tthis.data.setDescription(options.description);\n\n\t\tthis.data.setDescriptionLocalizations(options.descriptionLocalizations || null);\n\n\t\tthis.data.setDMPermission(options.permissions?.dm || null);\n\n\t\tif (options.args && options?.args?.length > 0) {\n\t\t\tthis.addArguments(this.data, options.args);\n\t\t}\n\n\t\tif (options.subcommands && options?.subcommands?.length > 0) {\n\t\t\tthis.addSubcommands(this.data, options.subcommands);\n\t\t}\n\n\t\tif (options.groups && options?.groups?.length > 0) {\n\t\t\tthis.addSubcommandGroups(options.groups);\n\t\t}\n\n\t\toptions = z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\tdescription: z.string(),\n\t\t\t\tusage: z.string().or(z.null()).default(null),\n\t\t\t\tinfo: z.string().or(z.null()).default(null),\n\t\t\t\tcategory: z.string().or(z.null()).default(null),\n\t\t\t\tnumber: z.number().or(z.null()).default(null),\n\t\t\t\tchannelType: z.array(z.number()).or(z.null()).default(null),\n\t\t\t\tignore: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tstrict: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\towner: z.boolean().default(false),\n\t\t\t\t\t\tusers: z.array(z.string()).default([]),\n\t\t\t\t\t\tchannels: z.array(z.string()).default([]),\n\t\t\t\t\t\tguilds: z.array(z.string()).default([]),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tpermissions: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\tuser: z.array(z.string()).default([]),\n\t\t\t\t\t\tclient: z.array(z.string()).default([]),\n\t\t\t\t\t\tdm: z.boolean().default(true),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t\tdefer: z\n\t\t\t\t\t.object({\n\t\t\t\t\t\treply: z.boolean().default(false),\n\t\t\t\t\t\tephemeral: z.boolean().default(false),\n\t\t\t\t\t\tfetch: z.boolean().default(false),\n\t\t\t\t\t})\n\t\t\t\t\t.default({}),\n\t\t\t})\n\t\t\t.parse(options);\n\n\t\tthis.name = options.name;\n\n\t\tthis.description = options.description;\n\n\t\tthis.usage = options.usage;\n\n\t\tthis.info = options.info;\n\n\t\tthis.category = options.category;\n\n\t\tthis.cooldown = options.cooldown;\n\n\t\tthis.ignore = options.ignore;\n\n\t\tthis.strict = options.strict;\n\n\t\tthis.permissions = options.permissions;\n\n\t\tthis.defer = options.defer;\n\n\t\tthis.client = this.client;\n\t}\n\n\t/**\n\t * @description autocomplete let's you add choices to string option arguments\n\t * @param interaction - The interaction event emitted on this command\n\t * @param focused - The command option that is in focus\n\t * @param options - The full list of options on the command\n\t */\n\tpublic async autocomplete<T>(\n\t\tinteraction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\tfocused: T,\n\t\toptions: T[]\n\t): Promise<void | any | T> {}\n\n\t/**\n\t * @description Checks for conditions before running the command\n\t * @param interaction - The interaction event emitted on this command\n\t * @param options - The args, group and subcommand parsed on this command\n\t */\n\tpublic async conditions<T>(\n\t\tinteraction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\t{ args, subcommand, group }: SlashCommandArguments\n\t): Promise<void | any | T> {}\n\n\t/**\n\t * @description Runs the execution rule\n\t * @param interaction - The interaction event emitted on this command\n\t * @param options - The args, group and subcommand parsed on this command\n\t */\n\tpublic async exec<T>(\n\t\tinteraction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,\n\t\t{ args, subcommand, group }: SlashCommandArguments\n\t): Promise<void | any | T> {\n\t\tnew XernerxLog(this.client).error(`${this.id} doesn't have an execution rule.`);\n\n\t\treturn await this.client.emit('commandError', interaction, `${this.id} doesn't have an execution rule.`, this, this.filetype);\n\t}\n\n\tprivate addArguments(command: Discord.SlashCommandBuilder | SlashCommandSubcommandBuilder, args: Array<SlashCommandArgumentOptions>) {\n\t\tfor (const argument of args) {\n\t\t\tlet slashCommandArgumentType: SlashCommandArgumentType | string = `${argument.type.charAt(0).toUpperCase()}${argument.type.slice(1).toLowerCase()}`;\n\n\t\t\t(command[`add${slashCommandArgumentType as UpperCasedSlashCommandArgumentOptions}Option`] as Function)((option: SlashCommandOption) => {\n\t\t\t\toption\n\t\t\t\t\t.setName(argument.name)\n\t\t\t\t\t.setDescription(argument.description)\n\t\t\t\t\t.setRequired(argument.required || false);\n\n\t\t\t\tif (slashCommandArgumentType === 'String') {\n\t\t\t\t\tif (argument.choices)\n\t\t\t\t\t\t(option as SlashCommandStringOption).setChoices(\n\t\t\t\t\t\t\t...(argument.choices.map((choices) => {\n\t\t\t\t\t\t\t\treturn { name: Object.keys(choices).at(0), value: Object.values(choices).at(0) };\n\t\t\t\t\t\t\t}) as Array<any>)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t(option as SlashCommandStringOption).setAutocomplete(argument.autocomplete || false);\n\t\t\t\t}\n\n\t\t\t\treturn option;\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate addSubcommands(method: Discord.SlashCommandBuilder | SlashCommandSubcommandGroupBuilder, subcommands: Array<SlashCommandSubcommandOptions>) {\n\t\tfor (const subcommand of subcommands) {\n\t\t\tlet sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);\n\n\t\t\tif (subcommand.args && subcommand?.args?.length > 0) this.addArguments(sub, subcommand.args);\n\n\t\t\tmethod.addSubcommand(sub);\n\t\t}\n\t}\n\n\tprivate addSubcommandGroups(groups: Array<SlashCommandGroupOptions>) {\n\t\tfor (const group of groups) {\n\t\t\tlet subcommandGroup = new SlashCommandSubcommandGroupBuilder().setName(group.name).setDescription(group.description);\n\n\t\t\tif (group.subcommands?.length > 0) this.addSubcommands(subcommandGroup, group.subcommands);\n\n\t\t\tthis.data.addSubcommandGroup(subcommandGroup);\n\t\t}\n\t}\n}\n\ntype UpperCasedSlashCommandArgumentOptions = 'Attachment' | 'Boolean' | 'Channel' | 'Integer' | 'Mentionable' | 'Number' | 'Role' | 'String' | 'User';\n"]}
@@ -18,6 +18,9 @@ export default class XernerxClient<T = unknown> extends Client {
18
18
  ignore?:
19
19
  | {
20
20
  owner: boolean;
21
+ self: boolean;
22
+ bots: boolean;
23
+ system: boolean;
21
24
  users: string[];
22
25
  channels: string[];
23
26
  guilds: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"XernerxClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxClient.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5D,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,MAAM;IAC7D,SAAwB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;MAAC;IACjC,SAAwB,MAAM,wBAAC;IAC/B,SAAwB,QAAQ,EAAE,eAAe,CAAC;IAClD,SAAwB,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACjE,SAAwB,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACzE,SAAwB,OAAO,EAAE,aAAa,CAAC;IAC/C,SAAwB,IAAI,EAAE,UAAU,CAAC;IACzC,SAAwB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,SAAwB,KAAK,EAAE,YAAY,CAAC;gBAEzB,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC;IA8E/E,OAAO,CAAC,KAAK,EAAE,MAAM;CASlC"}
1
+ {"version":3,"file":"XernerxClient.d.ts","sourceRoot":"","sources":["../../src/client/XernerxClient.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,MAAM,EAAE,aAAa,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