xernerx 4.5.6 → 4.5.7

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 (73) hide show
  1. package/dist/build/XernerxContextCommand.d.ts +46 -44
  2. package/dist/build/XernerxContextCommand.js +64 -62
  3. package/dist/build/XernerxEvent.d.ts +16 -14
  4. package/dist/build/XernerxEvent.js +21 -19
  5. package/dist/build/XernerxInhibitor.d.ts +19 -17
  6. package/dist/build/XernerxInhibitor.js +13 -11
  7. package/dist/build/XernerxMessageCommand.d.ts +44 -42
  8. package/dist/build/XernerxMessageCommand.js +58 -56
  9. package/dist/build/XernerxSlashCommand.d.ts +56 -54
  10. package/dist/build/XernerxSlashCommand.js +110 -108
  11. package/dist/client/XernerxClient.d.ts +46 -44
  12. package/dist/client/XernerxClient.js +75 -73
  13. package/dist/client/XernerxShardClient.d.ts +12 -10
  14. package/dist/client/XernerxShardClient.js +50 -48
  15. package/dist/functions/deploy.d.ts +2 -0
  16. package/dist/functions/deploy.js +32 -30
  17. package/dist/functions/load.d.ts +2 -0
  18. package/dist/functions/load.js +29 -27
  19. package/dist/functions/reload.d.ts +2 -0
  20. package/dist/functions/reload.js +36 -34
  21. package/dist/functions/sendWebhook.d.ts +2 -0
  22. package/dist/functions/sendWebhook.js +12 -10
  23. package/dist/functions/setPresence.d.ts +2 -0
  24. package/dist/functions/setPresence.js +19 -17
  25. package/dist/functions/xernerxUser.d.ts +2 -0
  26. package/dist/functions/xernerxUser.js +10 -8
  27. package/dist/handlers/CommandHandler.d.ts +10 -8
  28. package/dist/handlers/CommandHandler.js +241 -239
  29. package/dist/handlers/EventHandler.d.ts +4 -2
  30. package/dist/handlers/EventHandler.js +20 -18
  31. package/dist/handlers/ExtensionHandler.d.ts +4 -2
  32. package/dist/handlers/ExtensionHandler.js +19 -17
  33. package/dist/handlers/Handler.d.ts +9 -7
  34. package/dist/handlers/Handler.js +33 -31
  35. package/dist/handlers/InhibitorHandler.d.ts +4 -2
  36. package/dist/handlers/InhibitorHandler.js +20 -18
  37. package/dist/handlers/WebhookHandler.d.ts +5 -3
  38. package/dist/handlers/WebhookHandler.js +48 -46
  39. package/dist/main.d.ts +28 -26
  40. package/dist/main.js +28 -26
  41. package/dist/models/Arguments.d.ts +4 -2
  42. package/dist/models/Arguments.js +136 -134
  43. package/dist/tools/XernerxError.d.ts +6 -4
  44. package/dist/tools/XernerxError.js +10 -8
  45. package/dist/tools/XernerxLog.d.ts +14 -12
  46. package/dist/tools/XernerxLog.js +77 -80
  47. package/dist/types/extenders.d.ts +13 -11
  48. package/dist/types/extenders.js +2 -0
  49. package/dist/types/interfaces.d.ts +184 -172
  50. package/dist/types/interfaces.d.ts.map +1 -1
  51. package/dist/types/interfaces.js +2 -0
  52. package/dist/types/interfaces.js.map +1 -1
  53. package/dist/types/types.d.ts +173 -171
  54. package/dist/types/types.js +2 -0
  55. package/dist/utils/ClientUtil.d.ts +8 -5
  56. package/dist/utils/ClientUtil.d.ts.map +1 -1
  57. package/dist/utils/ClientUtil.js +45 -26
  58. package/dist/utils/ClientUtil.js.map +1 -1
  59. package/dist/utils/InteractionUtil.d.ts +11 -5
  60. package/dist/utils/InteractionUtil.d.ts.map +1 -1
  61. package/dist/utils/InteractionUtil.js +98 -8
  62. package/dist/utils/InteractionUtil.js.map +1 -1
  63. package/dist/utils/MessageUtil.d.ts +14 -9
  64. package/dist/utils/MessageUtil.d.ts.map +1 -1
  65. package/dist/utils/MessageUtil.js +131 -37
  66. package/dist/utils/MessageUtil.js.map +1 -1
  67. package/dist/utils/Util.d.ts +5 -3
  68. package/dist/utils/Util.js +9 -7
  69. package/dist/validators/commandValidation.d.ts +4 -2
  70. package/dist/validators/commandValidation.js +44 -42
  71. package/dist/validators/inhibitorValidations.d.ts +16 -14
  72. package/dist/validators/inhibitorValidations.js +32 -30
  73. package/package.json +1 -1
@@ -1,51 +1,53 @@
1
+ /** @format */
2
+
1
3
  import { ContextMenuCommandBuilder } from 'discord.js';
2
4
  import XernerxClient from '../client/XernerxClient.js';
3
5
  import { XernerxMessageContextInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
4
6
  import { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';
5
7
  export default class XernerxContextCommand {
6
- readonly id: string;
7
- readonly data: ContextMenuCommandBuilder;
8
- readonly name: string;
9
- readonly type: 'user' | 'message';
10
- readonly description: string | null | undefined;
11
- readonly usage: string | null | undefined;
12
- readonly info: string | null | undefined;
13
- readonly category: string | null | undefined;
14
- readonly cooldown: number | null | undefined;
15
- readonly ignore:
16
- | {
17
- owner?: boolean | undefined;
18
- users?: string[] | undefined;
19
- channels?: string[] | undefined;
20
- guilds?: string[] | undefined;
21
- }
22
- | undefined;
23
- readonly strict:
24
- | {
25
- owner?: boolean | undefined;
26
- users?: string[] | undefined;
27
- channels?: string[] | undefined;
28
- guilds?: string[] | undefined;
29
- }
30
- | undefined;
31
- readonly permissions:
32
- | {
33
- user?: string[] | import('../main.js').PermissionNames[] | undefined;
34
- client?: string[] | import('../main.js').PermissionNames[] | undefined;
35
- dm?: boolean | undefined;
36
- }
37
- | undefined;
38
- readonly defer:
39
- | {
40
- reply?: boolean | undefined;
41
- ephemeral?: boolean | undefined;
42
- fetchReply?: boolean | undefined;
43
- }
44
- | undefined;
45
- readonly fileType: 'ContextCommand';
46
- readonly filePath: string;
47
- readonly client: typeof XernerxClient;
48
- constructor(id: string, options: ContextCommandOptions);
49
- exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T>;
8
+ readonly id: string;
9
+ readonly data: ContextMenuCommandBuilder;
10
+ readonly name: string;
11
+ readonly type: 'user' | 'message';
12
+ readonly description: string | null | undefined;
13
+ readonly usage: string | null | undefined;
14
+ readonly info: string | null | undefined;
15
+ readonly category: string | null | undefined;
16
+ readonly cooldown: number | null | undefined;
17
+ readonly ignore:
18
+ | {
19
+ owner?: boolean | undefined;
20
+ users?: string[] | undefined;
21
+ channels?: string[] | undefined;
22
+ guilds?: string[] | undefined;
23
+ }
24
+ | undefined;
25
+ readonly strict:
26
+ | {
27
+ owner?: boolean | undefined;
28
+ users?: string[] | undefined;
29
+ channels?: string[] | undefined;
30
+ guilds?: string[] | undefined;
31
+ }
32
+ | undefined;
33
+ readonly permissions:
34
+ | {
35
+ user?: string[] | import('../main.js').PermissionNames[] | undefined;
36
+ client?: string[] | import('../main.js').PermissionNames[] | undefined;
37
+ dm?: boolean | undefined;
38
+ }
39
+ | undefined;
40
+ readonly defer:
41
+ | {
42
+ reply?: boolean | undefined;
43
+ ephemeral?: boolean | undefined;
44
+ fetchReply?: boolean | undefined;
45
+ }
46
+ | undefined;
47
+ readonly fileType: 'ContextCommand';
48
+ readonly filePath: string;
49
+ readonly client: typeof XernerxClient;
50
+ constructor(id: string, options: ContextCommandOptions);
51
+ exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T>;
50
52
  }
51
53
  //# sourceMappingURL=XernerxContextCommand.d.ts.map
@@ -1,68 +1,70 @@
1
+ /** @format */
2
+
1
3
  import { ContextMenuCommandBuilder } from 'discord.js';
2
4
  import { z } from 'zod';
3
5
  import XernerxClient from '../client/XernerxClient.js';
4
6
  export default class XernerxContextCommand {
5
- constructor(id, options) {
6
- this.id = id;
7
- this.data = new ContextMenuCommandBuilder();
8
- this.data.setName(options.name);
9
- this.data.setNameLocalizations(options.nameLocalizations || null);
10
- this.data.setType(options.type === 'user' ? 2 : 3);
11
- this.data.setDMPermission(options.permissions?.dm || null);
12
- options = z
13
- .object({
14
- name: z.string(),
15
- type: z.enum(['user', 'message']),
16
- description: z.string().or(z.null()).default(null),
17
- usage: z.string().or(z.null()).default(null),
18
- info: z.string().or(z.null()).default(null),
19
- category: z.string().or(z.null()).default(null),
20
- cooldown: z.number().or(z.null()).default(null),
21
- ignore: z
22
- .object({
23
- owner: z.boolean().default(false),
24
- users: z.array(z.string()).default([]),
25
- channels: z.array(z.string()).default([]),
26
- guilds: z.array(z.string()).default([]),
27
- })
28
- .default({}),
29
- strict: z
30
- .object({
31
- owner: z.boolean().default(false),
32
- users: z.array(z.string()).default([]),
33
- channels: z.array(z.string()).default([]),
34
- guilds: z.array(z.string()).default([]),
35
- })
36
- .default({}),
37
- permissions: z
38
- .object({
39
- user: z.array(z.string()).default([]),
40
- client: z.array(z.string()).default([]),
41
- dm: z.boolean().default(true),
42
- })
43
- .default({}),
44
- defer: z
45
- .object({
46
- reply: z.boolean().default(false),
47
- ephemeral: z.boolean().default(false),
48
- fetch: z.boolean().default(false),
49
- })
50
- .default({}),
51
- })
52
- .parse(options);
53
- this.name = options.name;
54
- this.type = options.type;
55
- this.description = options.description;
56
- this.usage = options.usage;
57
- this.info = options.info;
58
- this.category = options.category;
59
- this.cooldown = options.cooldown;
60
- this.ignore = options.ignore;
61
- this.strict = options.strict;
62
- this.permissions = options.permissions;
63
- this.defer = options.defer;
64
- this.client = XernerxClient;
65
- }
66
- async exec(interaction, args) {}
7
+ constructor(id, options) {
8
+ this.id = id;
9
+ this.data = new ContextMenuCommandBuilder();
10
+ this.data.setName(options.name);
11
+ this.data.setNameLocalizations(options.nameLocalizations || null);
12
+ this.data.setType(options.type === 'user' ? 2 : 3);
13
+ this.data.setDMPermission(options.permissions?.dm || null);
14
+ options = z
15
+ .object({
16
+ name: z.string(),
17
+ type: z.enum(['user', 'message']),
18
+ description: z.string().or(z.null()).default(null),
19
+ usage: z.string().or(z.null()).default(null),
20
+ info: z.string().or(z.null()).default(null),
21
+ category: z.string().or(z.null()).default(null),
22
+ cooldown: z.number().or(z.null()).default(null),
23
+ ignore: z
24
+ .object({
25
+ owner: z.boolean().default(false),
26
+ users: z.array(z.string()).default([]),
27
+ channels: z.array(z.string()).default([]),
28
+ guilds: z.array(z.string()).default([]),
29
+ })
30
+ .default({}),
31
+ strict: z
32
+ .object({
33
+ owner: z.boolean().default(false),
34
+ users: z.array(z.string()).default([]),
35
+ channels: z.array(z.string()).default([]),
36
+ guilds: z.array(z.string()).default([]),
37
+ })
38
+ .default({}),
39
+ permissions: z
40
+ .object({
41
+ user: z.array(z.string()).default([]),
42
+ client: z.array(z.string()).default([]),
43
+ dm: z.boolean().default(true),
44
+ })
45
+ .default({}),
46
+ defer: z
47
+ .object({
48
+ reply: z.boolean().default(false),
49
+ ephemeral: z.boolean().default(false),
50
+ fetch: z.boolean().default(false),
51
+ })
52
+ .default({}),
53
+ })
54
+ .parse(options);
55
+ this.name = options.name;
56
+ this.type = options.type;
57
+ this.description = options.description;
58
+ this.usage = options.usage;
59
+ this.info = options.info;
60
+ this.category = options.category;
61
+ this.cooldown = options.cooldown;
62
+ this.ignore = options.ignore;
63
+ this.strict = options.strict;
64
+ this.permissions = options.permissions;
65
+ this.defer = options.defer;
66
+ this.client = XernerxClient;
67
+ }
68
+ async exec(interaction, args) {}
67
69
  }
68
70
  //# sourceMappingURL=XernerxContextCommand.js.map
@@ -1,3 +1,5 @@
1
+ /** @format */
2
+
1
3
  import XernerxClient from '../client/XernerxClient.js';
2
4
  import { XernerxEventOptions } from '../types/interfaces.js';
3
5
  import { XernerxEventType } from '../types/types.js';
@@ -7,19 +9,19 @@ import { XernerxEventType } from '../types/types.js';
7
9
  * @param {EventOptions} options - The event options.
8
10
  */
9
11
  export default class XernerxEvent {
10
- readonly id: string;
11
- readonly name: XernerxEventType | string;
12
- readonly emitter?: 'client' | 'process' | string;
13
- readonly type?: 'discord' | string;
14
- readonly once?: boolean;
15
- readonly fileType: 'Event';
16
- readonly filePath: string;
17
- readonly client: typeof XernerxClient;
18
- constructor(id: string, options: XernerxEventOptions);
19
- /**
20
- * @description run your custom event here.
21
- * TODO - update description
22
- */
23
- run(...args: any): Promise<void>;
12
+ readonly id: string;
13
+ readonly name: XernerxEventType | string;
14
+ readonly emitter?: 'client' | 'process' | string;
15
+ readonly type?: 'discord' | string;
16
+ readonly once?: boolean;
17
+ readonly fileType: 'Event';
18
+ readonly filePath: string;
19
+ readonly client: typeof XernerxClient;
20
+ constructor(id: string, options: XernerxEventOptions);
21
+ /**
22
+ * @description run your custom event here.
23
+ * TODO - update description
24
+ */
25
+ run(...args: any): Promise<void>;
24
26
  }
25
27
  //# sourceMappingURL=XernerxEvent.d.ts.map
@@ -1,3 +1,5 @@
1
+ /** @format */
2
+
1
3
  import { z } from 'zod';
2
4
  import XernerxClient from '../client/XernerxClient.js';
3
5
  /**
@@ -6,24 +8,24 @@ import XernerxClient from '../client/XernerxClient.js';
6
8
  * @param {EventOptions} options - The event options.
7
9
  */
8
10
  export default class XernerxEvent {
9
- constructor(id, options) {
10
- this.id = id;
11
- z.object({
12
- name: z.string(),
13
- emitter: z.string().optional(),
14
- type: z.string().optional(),
15
- once: z.boolean().optional(),
16
- }).parse(options);
17
- this.name = options.name;
18
- this.emitter = options.emitter || 'client';
19
- this.type = options.type || 'discord';
20
- this.once = options.once || false;
21
- this.client = XernerxClient;
22
- }
23
- /**
24
- * @description run your custom event here.
25
- * TODO - update description
26
- */
27
- async run(...args) {}
11
+ constructor(id, options) {
12
+ this.id = id;
13
+ z.object({
14
+ name: z.string(),
15
+ emitter: z.string().optional(),
16
+ type: z.string().optional(),
17
+ once: z.boolean().optional(),
18
+ }).parse(options);
19
+ this.name = options.name;
20
+ this.emitter = options.emitter || 'client';
21
+ this.type = options.type || 'discord';
22
+ this.once = options.once || false;
23
+ this.client = XernerxClient;
24
+ }
25
+ /**
26
+ * @description run your custom event here.
27
+ * TODO - update description
28
+ */
29
+ async run(...args) {}
28
30
  }
29
31
  //# sourceMappingURL=XernerxEvent.js.map
@@ -1,3 +1,5 @@
1
+ /** @format */
2
+
1
3
  import XernerxClient from '../client/XernerxClient.js';
2
4
  import { XernerxInhibitorOptions, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';
3
5
  import { InhibitorType, XernerxInteraction } from '../types/types.js';
@@ -8,22 +10,22 @@ import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteracti
8
10
  * @param {InhibitorOptions} options - The inhibitor options.
9
11
  */
10
12
  export default class XernerxInhibitor {
11
- readonly id: string;
12
- readonly name: string;
13
- readonly type: InhibitorType;
14
- readonly fileType: 'Inhibitor';
15
- readonly filePath: string;
16
- readonly client: typeof XernerxClient;
17
- constructor(id: string, options: XernerxInhibitorOptions);
18
- check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(
19
- 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>;
13
+ readonly id: string;
14
+ readonly name: string;
15
+ readonly type: InhibitorType;
16
+ readonly fileType: 'Inhibitor';
17
+ readonly filePath: string;
18
+ readonly client: typeof XernerxClient;
19
+ constructor(id: string, options: XernerxInhibitorOptions);
20
+ check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(
21
+ interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
22
+ args: T extends XernerxMessage
23
+ ? MessageCommandArguments
24
+ : T extends XernerxSlashInteraction
25
+ ? SlashCommandArguments
26
+ : T extends XernerxUserContextInteraction
27
+ ? XernerxUserContextInteraction
28
+ : XernerxMessageContextInteraction | null
29
+ ): Promise<void | any | T>;
28
30
  }
29
31
  //# sourceMappingURL=XernerxInhibitor.d.ts.map
@@ -1,3 +1,5 @@
1
+ /** @format */
2
+
1
3
  import { z } from 'zod';
2
4
  import XernerxClient from '../client/XernerxClient.js';
3
5
  /**
@@ -6,16 +8,16 @@ import XernerxClient from '../client/XernerxClient.js';
6
8
  * @param {InhibitorOptions} options - The inhibitor options.
7
9
  */
8
10
  export default class XernerxInhibitor {
9
- constructor(id, options) {
10
- this.id = id;
11
- z.object({
12
- name: z.string(),
13
- type: z.string(),
14
- }).parse(options);
15
- this.name = options.name;
16
- this.type = options.type;
17
- this.client = XernerxClient;
18
- }
19
- async check(interaction, args) {}
11
+ constructor(id, options) {
12
+ this.id = id;
13
+ z.object({
14
+ name: z.string(),
15
+ type: z.string(),
16
+ }).parse(options);
17
+ this.name = options.name;
18
+ this.type = options.type;
19
+ this.client = XernerxClient;
20
+ }
21
+ async check(interaction, args) {}
20
22
  }
21
23
  //# sourceMappingURL=XernerxInhibitor.js.map
@@ -1,48 +1,50 @@
1
+ /** @format */
2
+
1
3
  import XernerxClient from '../client/XernerxClient.js';
2
4
  import { XernerxMessage } from '../types/extenders.js';
3
5
  import { MessageCommandArguments, MessageCommandOptions } from '../types/interfaces.js';
4
6
  export default class XernerxMessageCommand {
5
- readonly id: string;
6
- readonly name: string;
7
- readonly aliases: string[] | undefined;
8
- readonly regex: RegExp | undefined;
9
- readonly prefix: string | string[] | undefined;
10
- readonly description: string | null | undefined;
11
- readonly usage: string | null | undefined;
12
- readonly info: string | null | undefined;
13
- readonly separator: string | undefined;
14
- readonly args: import('../types/interfaces.js').MessageCommandArgumentOptions[] | undefined;
15
- readonly flags: import('../types/interfaces.js').MessageCommandFlagOptions[] | undefined;
16
- readonly category: string | null | undefined;
17
- readonly cooldown: number | null | undefined;
18
- readonly ignore:
19
- | {
20
- owner?: boolean | undefined;
21
- users?: string[] | undefined;
22
- channels?: string[] | undefined;
23
- guilds?: string[] | undefined;
24
- }
25
- | undefined;
26
- readonly strict:
27
- | {
28
- owner?: boolean | undefined;
29
- users?: string[] | undefined;
30
- channels?: string[] | undefined;
31
- guilds?: string[] | undefined;
32
- }
33
- | undefined;
34
- readonly permissions:
35
- | {
36
- user?: string[] | import('../main.js').PermissionNames[] | undefined;
37
- client?: string[] | import('../main.js').PermissionNames[] | undefined;
38
- dm?: boolean | undefined;
39
- }
40
- | undefined;
41
- readonly fileType: 'MessageCommand';
42
- readonly filePath: string;
43
- readonly client: typeof XernerxClient;
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>;
7
+ readonly id: string;
8
+ readonly name: string;
9
+ readonly aliases: string[] | undefined;
10
+ readonly regex: RegExp | undefined;
11
+ readonly prefix: string | string[] | undefined;
12
+ readonly description: string | null | undefined;
13
+ readonly usage: string | null | undefined;
14
+ readonly info: string | null | undefined;
15
+ readonly separator: string | undefined;
16
+ readonly args: import('../types/interfaces.js').MessageCommandArgumentOptions[] | undefined;
17
+ readonly flags: import('../types/interfaces.js').MessageCommandFlagOptions[] | undefined;
18
+ readonly category: string | null | undefined;
19
+ readonly cooldown: number | null | undefined;
20
+ readonly ignore:
21
+ | {
22
+ owner?: boolean | undefined;
23
+ users?: string[] | undefined;
24
+ channels?: string[] | undefined;
25
+ guilds?: string[] | undefined;
26
+ }
27
+ | undefined;
28
+ readonly strict:
29
+ | {
30
+ owner?: boolean | undefined;
31
+ users?: string[] | undefined;
32
+ channels?: string[] | undefined;
33
+ guilds?: string[] | undefined;
34
+ }
35
+ | undefined;
36
+ readonly permissions:
37
+ | {
38
+ user?: string[] | import('../main.js').PermissionNames[] | undefined;
39
+ client?: string[] | import('../main.js').PermissionNames[] | undefined;
40
+ dm?: boolean | undefined;
41
+ }
42
+ | undefined;
43
+ readonly fileType: 'MessageCommand';
44
+ readonly filePath: string;
45
+ readonly client: typeof XernerxClient;
46
+ constructor(id: string, options: MessageCommandOptions);
47
+ conditions<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
48
+ exec<T>(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<void | any | T>;
47
49
  }
48
50
  //# sourceMappingURL=XernerxMessageCommand.d.ts.map
@@ -1,61 +1,63 @@
1
+ /** @format */
2
+
1
3
  import { z } from 'zod';
2
4
  import XernerxClient from '../client/XernerxClient.js';
3
5
  export default class XernerxMessageCommand {
4
- constructor(id, options) {
5
- this.id = id;
6
- this.regex = options.regex;
7
- this.args = options.args;
8
- this.flags = options.flags;
9
- options = z
10
- .object({
11
- name: z.string(),
12
- aliases: z.array(z.string()).default([]),
13
- description: z.string().or(z.null()).default(null),
14
- usage: z.string().or(z.null()).default(null),
15
- info: z.string().or(z.null()).default(null),
16
- category: z.string().or(z.null()).default(null),
17
- cooldown: z.number().or(z.null()).default(null),
18
- prefix: z.array(z.string()).or(z.string()).default([]),
19
- ignore: z
20
- .object({
21
- owner: z.boolean().default(false),
22
- users: z.array(z.string()).default([]),
23
- channels: z.array(z.string()).default([]),
24
- guilds: z.array(z.string()).default([]),
25
- })
26
- .default({}),
27
- strict: z
28
- .object({
29
- owner: z.boolean().default(false),
30
- users: z.array(z.string()).default([]),
31
- channels: z.array(z.string()).default([]),
32
- guilds: z.array(z.string()).default([]),
33
- })
34
- .default({}),
35
- permissions: z
36
- .object({
37
- user: z.array(z.string()).default([]),
38
- client: z.array(z.string()).default([]),
39
- dm: z.boolean().default(true),
40
- })
41
- .default({}),
42
- })
43
- .parse(options);
44
- this.name = options.name;
45
- this.aliases = options.aliases;
46
- this.prefix = options.prefix;
47
- this.description = options.description;
48
- this.usage = options.usage;
49
- this.info = options.info;
50
- this.category = options.category;
51
- this.cooldown = options.cooldown;
52
- this.ignore = options.ignore;
53
- this.strict = options.strict;
54
- this.separator = options.separator;
55
- this.permissions = options.permissions;
56
- this.client = XernerxClient;
57
- }
58
- async conditions(message, { args, flags }) {}
59
- async exec(message, { args, flags }) {}
6
+ constructor(id, options) {
7
+ this.id = id;
8
+ this.regex = options.regex;
9
+ this.args = options.args;
10
+ this.flags = options.flags;
11
+ options = z
12
+ .object({
13
+ name: z.string(),
14
+ aliases: z.array(z.string()).default([]),
15
+ description: z.string().or(z.null()).default(null),
16
+ usage: z.string().or(z.null()).default(null),
17
+ info: z.string().or(z.null()).default(null),
18
+ category: z.string().or(z.null()).default(null),
19
+ cooldown: z.number().or(z.null()).default(null),
20
+ prefix: z.array(z.string()).or(z.string()).default([]),
21
+ ignore: z
22
+ .object({
23
+ owner: z.boolean().default(false),
24
+ users: z.array(z.string()).default([]),
25
+ channels: z.array(z.string()).default([]),
26
+ guilds: z.array(z.string()).default([]),
27
+ })
28
+ .default({}),
29
+ strict: z
30
+ .object({
31
+ owner: z.boolean().default(false),
32
+ users: z.array(z.string()).default([]),
33
+ channels: z.array(z.string()).default([]),
34
+ guilds: z.array(z.string()).default([]),
35
+ })
36
+ .default({}),
37
+ permissions: z
38
+ .object({
39
+ user: z.array(z.string()).default([]),
40
+ client: z.array(z.string()).default([]),
41
+ dm: z.boolean().default(true),
42
+ })
43
+ .default({}),
44
+ })
45
+ .parse(options);
46
+ this.name = options.name;
47
+ this.aliases = options.aliases;
48
+ this.prefix = options.prefix;
49
+ this.description = options.description;
50
+ this.usage = options.usage;
51
+ this.info = options.info;
52
+ this.category = options.category;
53
+ this.cooldown = options.cooldown;
54
+ this.ignore = options.ignore;
55
+ this.strict = options.strict;
56
+ this.separator = options.separator;
57
+ this.permissions = options.permissions;
58
+ this.client = XernerxClient;
59
+ }
60
+ async conditions(message, { args, flags }) {}
61
+ async exec(message, { args, flags }) {}
60
62
  }
61
63
  //# sourceMappingURL=XernerxMessageCommand.js.map