xernerx 4.5.28 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/build/XernerxContextCommand.d.ts +4 -1
  2. package/dist/build/XernerxContextCommand.js +44 -1
  3. package/dist/build/XernerxEvent.d.ts +0 -1
  4. package/dist/build/XernerxEvent.js +0 -1
  5. package/dist/build/XernerxInhibitor.d.ts +0 -1
  6. package/dist/build/XernerxInhibitor.js +0 -1
  7. package/dist/build/XernerxMessageCommand.d.ts +4 -1
  8. package/dist/build/XernerxMessageCommand.js +44 -1
  9. package/dist/build/XernerxSlashCommand.d.ts +4 -1
  10. package/dist/build/XernerxSlashCommand.js +44 -2
  11. package/dist/client/XernerxClient.d.ts +2 -2
  12. package/dist/client/XernerxClient.js +2 -1
  13. package/dist/client/XernerxShardClient.d.ts +0 -1
  14. package/dist/client/XernerxShardClient.js +0 -1
  15. package/dist/functions/deploy.d.ts +0 -1
  16. package/dist/functions/deploy.js +14 -10
  17. package/dist/functions/load.d.ts +0 -1
  18. package/dist/functions/load.js +0 -1
  19. package/dist/functions/reload.d.ts +0 -1
  20. package/dist/functions/reload.js +0 -1
  21. package/dist/functions/sendWebhook.d.ts +0 -1
  22. package/dist/functions/sendWebhook.js +0 -1
  23. package/dist/functions/setPresence.d.ts +0 -1
  24. package/dist/functions/setPresence.js +0 -1
  25. package/dist/functions/xernerxUser.d.ts +0 -1
  26. package/dist/functions/xernerxUser.js +0 -1
  27. package/dist/handlers/CommandHandler.d.ts +2 -2
  28. package/dist/handlers/CommandHandler.js +11 -3
  29. package/dist/handlers/EventHandler.d.ts +0 -1
  30. package/dist/handlers/EventHandler.js +0 -1
  31. package/dist/handlers/ExtensionHandler.d.ts +0 -1
  32. package/dist/handlers/ExtensionHandler.js +0 -1
  33. package/dist/handlers/Handler.d.ts +0 -1
  34. package/dist/handlers/Handler.js +0 -1
  35. package/dist/handlers/InhibitorHandler.d.ts +0 -1
  36. package/dist/handlers/InhibitorHandler.js +0 -1
  37. package/dist/handlers/WebhookHandler.d.ts +0 -1
  38. package/dist/handlers/WebhookHandler.js +0 -1
  39. package/dist/main.d.ts +5 -2
  40. package/dist/main.js +24 -2
  41. package/dist/models/Arguments.d.ts +0 -1
  42. package/dist/models/Arguments.js +0 -1
  43. package/dist/tools/XernerxError.d.ts +0 -1
  44. package/dist/tools/XernerxError.js +0 -1
  45. package/dist/tools/XernerxLog.d.ts +1 -1
  46. package/dist/tools/XernerxLog.js +6 -4
  47. package/dist/tools/XernerxText.d.ts +0 -1
  48. package/dist/tools/XernerxText.js +0 -1
  49. package/dist/types/extenders.d.ts +0 -1
  50. package/dist/types/extenders.js +0 -1
  51. package/dist/types/interfaces.d.ts +5 -1
  52. package/dist/types/interfaces.js +0 -1
  53. package/dist/types/types.d.ts +0 -1
  54. package/dist/types/types.js +0 -1
  55. package/dist/utils/ClientUtil.d.ts +0 -1
  56. package/dist/utils/ClientUtil.js +0 -1
  57. package/dist/utils/InteractionUtil.d.ts +0 -1
  58. package/dist/utils/InteractionUtil.js +0 -1
  59. package/dist/utils/MessageUtil.d.ts +2 -3
  60. package/dist/utils/MessageUtil.js +0 -1
  61. package/dist/utils/Util.d.ts +0 -1
  62. package/dist/utils/Util.js +0 -1
  63. package/dist/validators/commandValidation.d.ts +0 -1
  64. package/dist/validators/commandValidation.js +10 -1
  65. package/dist/validators/inhibitorValidations.d.ts +0 -1
  66. package/dist/validators/inhibitorValidations.js +0 -1
  67. package/package.json +4 -4
  68. package/dist/build/XernerxContextCommand.d.ts.map +0 -1
  69. package/dist/build/XernerxContextCommand.js.map +0 -1
  70. package/dist/build/XernerxEvent.d.ts.map +0 -1
  71. package/dist/build/XernerxEvent.js.map +0 -1
  72. package/dist/build/XernerxInhibitor.d.ts.map +0 -1
  73. package/dist/build/XernerxInhibitor.js.map +0 -1
  74. package/dist/build/XernerxMessageCommand.d.ts.map +0 -1
  75. package/dist/build/XernerxMessageCommand.js.map +0 -1
  76. package/dist/build/XernerxSlashCommand.d.ts.map +0 -1
  77. package/dist/build/XernerxSlashCommand.js.map +0 -1
  78. package/dist/client/XernerxClient.d.ts.map +0 -1
  79. package/dist/client/XernerxClient.js.map +0 -1
  80. package/dist/client/XernerxShardClient.d.ts.map +0 -1
  81. package/dist/client/XernerxShardClient.js.map +0 -1
  82. package/dist/functions/deploy.d.ts.map +0 -1
  83. package/dist/functions/deploy.js.map +0 -1
  84. package/dist/functions/load.d.ts.map +0 -1
  85. package/dist/functions/load.js.map +0 -1
  86. package/dist/functions/reload.d.ts.map +0 -1
  87. package/dist/functions/reload.js.map +0 -1
  88. package/dist/functions/sendWebhook.d.ts.map +0 -1
  89. package/dist/functions/sendWebhook.js.map +0 -1
  90. package/dist/functions/setPresence.d.ts.map +0 -1
  91. package/dist/functions/setPresence.js.map +0 -1
  92. package/dist/functions/xernerxUser.d.ts.map +0 -1
  93. package/dist/functions/xernerxUser.js.map +0 -1
  94. package/dist/handlers/CommandHandler.d.ts.map +0 -1
  95. package/dist/handlers/CommandHandler.js.map +0 -1
  96. package/dist/handlers/EventHandler.d.ts.map +0 -1
  97. package/dist/handlers/EventHandler.js.map +0 -1
  98. package/dist/handlers/ExtensionHandler.d.ts.map +0 -1
  99. package/dist/handlers/ExtensionHandler.js.map +0 -1
  100. package/dist/handlers/Handler.d.ts.map +0 -1
  101. package/dist/handlers/Handler.js.map +0 -1
  102. package/dist/handlers/InhibitorHandler.d.ts.map +0 -1
  103. package/dist/handlers/InhibitorHandler.js.map +0 -1
  104. package/dist/handlers/WebhookHandler.d.ts.map +0 -1
  105. package/dist/handlers/WebhookHandler.js.map +0 -1
  106. package/dist/main.d.ts.map +0 -1
  107. package/dist/main.js.map +0 -1
  108. package/dist/models/Arguments.d.ts.map +0 -1
  109. package/dist/models/Arguments.js.map +0 -1
  110. package/dist/tools/XernerxError.d.ts.map +0 -1
  111. package/dist/tools/XernerxError.js.map +0 -1
  112. package/dist/tools/XernerxLog.d.ts.map +0 -1
  113. package/dist/tools/XernerxLog.js.map +0 -1
  114. package/dist/tools/XernerxText.d.ts.map +0 -1
  115. package/dist/tools/XernerxText.js.map +0 -1
  116. package/dist/types/extenders.d.ts.map +0 -1
  117. package/dist/types/extenders.js.map +0 -1
  118. package/dist/types/interfaces.d.ts.map +0 -1
  119. package/dist/types/interfaces.js.map +0 -1
  120. package/dist/types/types.d.ts.map +0 -1
  121. package/dist/types/types.js.map +0 -1
  122. package/dist/utils/ClientUtil.d.ts.map +0 -1
  123. package/dist/utils/ClientUtil.js.map +0 -1
  124. package/dist/utils/InteractionUtil.d.ts.map +0 -1
  125. package/dist/utils/InteractionUtil.js.map +0 -1
  126. package/dist/utils/MessageUtil.d.ts.map +0 -1
  127. package/dist/utils/MessageUtil.js.map +0 -1
  128. package/dist/utils/Util.d.ts.map +0 -1
  129. package/dist/utils/Util.js.map +0 -1
  130. package/dist/validators/commandValidation.d.ts.map +0 -1
  131. package/dist/validators/commandValidation.js.map +0 -1
  132. package/dist/validators/inhibitorValidations.d.ts.map +0 -1
  133. package/dist/validators/inhibitorValidations.js.map +0 -1
@@ -12,17 +12,21 @@ export default class XernerxContextCommand {
12
12
  readonly info: string | null | undefined;
13
13
  readonly category: string | null | undefined;
14
14
  readonly cooldown: number | null | undefined;
15
+ readonly channel: ("GuildText" | "DM" | "GuildVoice" | "GroupDM" | "GuildCategory" | "GuildAnnouncement" | "AnnouncementThread" | "PublicThread" | "PrivateThread" | "GuildStageVoice" | "GuildDirectory" | "GuildForum" | "GuildNews" | "GuildNewsThread" | "GuildPublicThread" | "GuildPrivateThread")[] | null;
16
+ readonly global: boolean | undefined;
15
17
  readonly ignore: {
16
18
  owner?: boolean | undefined;
17
19
  users?: string[] | undefined;
18
20
  channels?: string[] | undefined;
19
21
  guilds?: string[] | undefined;
22
+ voice?: boolean | undefined;
20
23
  } | undefined;
21
24
  readonly strict: {
22
25
  owner?: boolean | undefined;
23
26
  users?: string[] | undefined;
24
27
  channels?: string[] | undefined;
25
28
  guilds?: string[] | undefined;
29
+ voice?: boolean | undefined;
26
30
  } | undefined;
27
31
  readonly permissions: {
28
32
  user?: string[] | import("../main.js").PermissionNames[] | undefined;
@@ -45,4 +49,3 @@ export default class XernerxContextCommand {
45
49
  */
46
50
  exec(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<any>;
47
51
  }
48
- //# sourceMappingURL=XernerxContextCommand.d.ts.map
@@ -19,12 +19,53 @@ export default class XernerxContextCommand {
19
19
  info: z.string().or(z.null()).default(null),
20
20
  category: z.string().or(z.null()).default(null),
21
21
  cooldown: z.number().or(z.null()).default(null),
22
+ global: z.boolean().default(true),
23
+ channel: z
24
+ .array(z.enum([
25
+ 'GuildText',
26
+ 'DM',
27
+ 'GuildVoice',
28
+ 'GroupDM',
29
+ 'GuildCategory',
30
+ 'GuildAnnouncement',
31
+ 'AnnouncementThread',
32
+ 'PublicThread',
33
+ 'PrivateThread',
34
+ 'GuildStageVoice',
35
+ 'GuildDirectory',
36
+ 'GuildForum',
37
+ 'GuildNews',
38
+ 'GuildNewsThread',
39
+ 'GuildPublicThread',
40
+ 'GuildPrivateThread',
41
+ ]))
42
+ .or(z.enum([
43
+ 'GuildText',
44
+ 'DM',
45
+ 'GuildVoice',
46
+ 'GroupDM',
47
+ 'GuildCategory',
48
+ 'GuildAnnouncement',
49
+ 'AnnouncementThread',
50
+ 'PublicThread',
51
+ 'PrivateThread',
52
+ 'GuildStageVoice',
53
+ 'GuildDirectory',
54
+ 'GuildForum',
55
+ 'GuildNews',
56
+ 'GuildNewsThread',
57
+ 'GuildPublicThread',
58
+ 'GuildPrivateThread',
59
+ ]))
60
+ .or(z.null())
61
+ .default(null),
22
62
  ignore: z
23
63
  .object({
24
64
  owner: z.boolean().default(false),
25
65
  users: z.array(z.string()).default([]),
26
66
  channels: z.array(z.string()).default([]),
27
67
  guilds: z.array(z.string()).default([]),
68
+ voice: z.boolean().default(false),
28
69
  })
29
70
  .default({}),
30
71
  strict: z
@@ -33,6 +74,7 @@ export default class XernerxContextCommand {
33
74
  users: z.array(z.string()).default([]),
34
75
  channels: z.array(z.string()).default([]),
35
76
  guilds: z.array(z.string()).default([]),
77
+ voice: z.boolean().default(false),
36
78
  })
37
79
  .default({}),
38
80
  permissions: z
@@ -58,6 +100,8 @@ export default class XernerxContextCommand {
58
100
  this.info = options.info;
59
101
  this.category = options.category;
60
102
  this.cooldown = options.cooldown;
103
+ this.channel = options.channel ? (Array.isArray(options.channel) ? options.channel : [options.channel]) : null;
104
+ this.global = options.global;
61
105
  this.ignore = options.ignore;
62
106
  this.strict = options.strict;
63
107
  this.permissions = options.permissions;
@@ -74,4 +118,3 @@ export default class XernerxContextCommand {
74
118
  return await this.client.emit('commandError', interaction, `${this.id} doesn't have an execution rule.`, this, this.filetype);
75
119
  }
76
120
  }
77
- //# sourceMappingURL=XernerxContextCommand.js.map
@@ -23,4 +23,3 @@ export default class XernerxEvent {
23
23
  */
24
24
  run(...args: any): Promise<any>;
25
25
  }
26
- //# sourceMappingURL=XernerxEvent.d.ts.map
@@ -29,4 +29,3 @@ export default class XernerxEvent {
29
29
  return new XernerxLog(this.client).error(`${this.id} doesn't have a run rule.`);
30
30
  }
31
31
  }
32
- //# sourceMappingURL=XernerxEvent.js.map
@@ -23,4 +23,3 @@ export default class XernerxInhibitor {
23
23
  */
24
24
  check<T extends XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>>(interaction: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, args: (T extends XernerxMessage ? MessageCommandArguments : T extends XernerxSlashInteraction ? SlashCommandArguments : T extends XernerxUserContextInteraction ? ContextCommandArguments<'user' | 'message'> : never) | null, command: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand): Promise<any>;
25
25
  }
26
- //# sourceMappingURL=XernerxInhibitor.d.ts.map
@@ -27,4 +27,3 @@ export default class XernerxInhibitor {
27
27
  return await this.client.emit('commandError', interaction, `${this.name} doesn't have a check rule.`, this, this.filetype);
28
28
  }
29
29
  }
30
- //# sourceMappingURL=XernerxInhibitor.js.map
@@ -15,17 +15,21 @@ export default class XernerxMessageCommand {
15
15
  readonly flags: import("../main.js").MessageCommandFlagOptions[] | undefined;
16
16
  readonly category: string | null | undefined;
17
17
  readonly cooldown: number | null | undefined;
18
+ readonly channel: ("GuildText" | "DM" | "GuildVoice" | "GroupDM" | "GuildCategory" | "GuildAnnouncement" | "AnnouncementThread" | "PublicThread" | "PrivateThread" | "GuildStageVoice" | "GuildDirectory" | "GuildForum" | "GuildNews" | "GuildNewsThread" | "GuildPublicThread" | "GuildPrivateThread")[] | null;
19
+ readonly global: boolean | undefined;
18
20
  readonly ignore: {
19
21
  owner?: boolean | undefined;
20
22
  users?: string[] | undefined;
21
23
  channels?: string[] | undefined;
22
24
  guilds?: string[] | undefined;
25
+ voice?: boolean | undefined;
23
26
  } | undefined;
24
27
  readonly strict: {
25
28
  owner?: boolean | undefined;
26
29
  users?: string[] | undefined;
27
30
  channels?: string[] | undefined;
28
31
  guilds?: string[] | undefined;
32
+ voice?: boolean | undefined;
29
33
  } | undefined;
30
34
  readonly permissions: {
31
35
  user?: string[] | import("../main.js").PermissionNames[] | undefined;
@@ -49,4 +53,3 @@ export default class XernerxMessageCommand {
49
53
  */
50
54
  exec(message: XernerxMessage, { args, flags }: MessageCommandArguments): Promise<any>;
51
55
  }
52
- //# sourceMappingURL=XernerxMessageCommand.d.ts.map
@@ -16,6 +16,46 @@ export default class XernerxMessageCommand {
16
16
  info: z.string().or(z.null()).default(null),
17
17
  category: z.string().or(z.null()).default(null),
18
18
  cooldown: z.number().or(z.null()).default(null),
19
+ global: z.boolean().default(true),
20
+ channel: z
21
+ .array(z.enum([
22
+ 'GuildText',
23
+ 'DM',
24
+ 'GuildVoice',
25
+ 'GroupDM',
26
+ 'GuildCategory',
27
+ 'GuildAnnouncement',
28
+ 'AnnouncementThread',
29
+ 'PublicThread',
30
+ 'PrivateThread',
31
+ 'GuildStageVoice',
32
+ 'GuildDirectory',
33
+ 'GuildForum',
34
+ 'GuildNews',
35
+ 'GuildNewsThread',
36
+ 'GuildPublicThread',
37
+ 'GuildPrivateThread',
38
+ ]))
39
+ .or(z.enum([
40
+ 'GuildText',
41
+ 'DM',
42
+ 'GuildVoice',
43
+ 'GroupDM',
44
+ 'GuildCategory',
45
+ 'GuildAnnouncement',
46
+ 'AnnouncementThread',
47
+ 'PublicThread',
48
+ 'PrivateThread',
49
+ 'GuildStageVoice',
50
+ 'GuildDirectory',
51
+ 'GuildForum',
52
+ 'GuildNews',
53
+ 'GuildNewsThread',
54
+ 'GuildPublicThread',
55
+ 'GuildPrivateThread',
56
+ ]))
57
+ .or(z.null())
58
+ .default(null),
19
59
  prefix: z.array(z.string()).or(z.string()).default([]),
20
60
  ignore: z
21
61
  .object({
@@ -23,6 +63,7 @@ export default class XernerxMessageCommand {
23
63
  users: z.array(z.string()).default([]),
24
64
  channels: z.array(z.string()).default([]),
25
65
  guilds: z.array(z.string()).default([]),
66
+ voice: z.boolean().default(false),
26
67
  })
27
68
  .default({}),
28
69
  strict: z
@@ -31,6 +72,7 @@ export default class XernerxMessageCommand {
31
72
  users: z.array(z.string()).default([]),
32
73
  channels: z.array(z.string()).default([]),
33
74
  guilds: z.array(z.string()).default([]),
75
+ voice: z.boolean().default(false),
34
76
  })
35
77
  .default({}),
36
78
  permissions: z
@@ -50,6 +92,8 @@ export default class XernerxMessageCommand {
50
92
  this.info = options.info;
51
93
  this.category = options.category;
52
94
  this.cooldown = options.cooldown;
95
+ this.channel = options.channel ? (Array.isArray(options.channel) ? options.channel : [options.channel]) : null;
96
+ this.global = options.global;
53
97
  this.ignore = options.ignore;
54
98
  this.strict = options.strict;
55
99
  this.separator = options.separator;
@@ -72,4 +116,3 @@ export default class XernerxMessageCommand {
72
116
  return await this.client.emit('commandError', message, `${this.id} doesn't have an execution rule.`, this, this.filetype);
73
117
  }
74
118
  }
75
- //# sourceMappingURL=XernerxMessageCommand.js.map
@@ -12,17 +12,21 @@ export default class XernerxSlashCommand {
12
12
  readonly info: string | null | undefined;
13
13
  readonly category: string | null | undefined;
14
14
  readonly cooldown: number | null | undefined;
15
+ readonly channel: ("GuildText" | "DM" | "GuildVoice" | "GroupDM" | "GuildCategory" | "GuildAnnouncement" | "AnnouncementThread" | "PublicThread" | "PrivateThread" | "GuildStageVoice" | "GuildDirectory" | "GuildForum" | "GuildNews" | "GuildNewsThread" | "GuildPublicThread" | "GuildPrivateThread")[] | null;
16
+ readonly global: boolean | undefined;
15
17
  readonly ignore: {
16
18
  owner?: boolean | undefined;
17
19
  users?: string[] | undefined;
18
20
  channels?: string[] | undefined;
19
21
  guilds?: string[] | undefined;
22
+ voice?: boolean | undefined;
20
23
  } | undefined;
21
24
  readonly strict: {
22
25
  owner?: boolean | undefined;
23
26
  users?: string[] | undefined;
24
27
  channels?: string[] | undefined;
25
28
  guilds?: string[] | undefined;
29
+ voice?: boolean | undefined;
26
30
  } | undefined;
27
31
  readonly permissions: {
28
32
  user?: string[] | import("../main.js").PermissionNames[] | undefined;
@@ -61,4 +65,3 @@ export default class XernerxSlashCommand {
61
65
  private addSubcommands;
62
66
  private addSubcommandGroups;
63
67
  }
64
- //# sourceMappingURL=XernerxSlashCommand.d.ts.map
@@ -28,13 +28,53 @@ export default class XernerxSlashCommand {
28
28
  info: z.string().or(z.null()).default(null),
29
29
  category: z.string().or(z.null()).default(null),
30
30
  number: z.number().or(z.null()).default(null),
31
- channelType: z.array(z.number()).or(z.null()).default(null),
31
+ global: z.boolean().default(true),
32
+ channel: z
33
+ .array(z.enum([
34
+ 'GuildText',
35
+ 'DM',
36
+ 'GuildVoice',
37
+ 'GroupDM',
38
+ 'GuildCategory',
39
+ 'GuildAnnouncement',
40
+ 'AnnouncementThread',
41
+ 'PublicThread',
42
+ 'PrivateThread',
43
+ 'GuildStageVoice',
44
+ 'GuildDirectory',
45
+ 'GuildForum',
46
+ 'GuildNews',
47
+ 'GuildNewsThread',
48
+ 'GuildPublicThread',
49
+ 'GuildPrivateThread',
50
+ ]))
51
+ .or(z.enum([
52
+ 'GuildText',
53
+ 'DM',
54
+ 'GuildVoice',
55
+ 'GroupDM',
56
+ 'GuildCategory',
57
+ 'GuildAnnouncement',
58
+ 'AnnouncementThread',
59
+ 'PublicThread',
60
+ 'PrivateThread',
61
+ 'GuildStageVoice',
62
+ 'GuildDirectory',
63
+ 'GuildForum',
64
+ 'GuildNews',
65
+ 'GuildNewsThread',
66
+ 'GuildPublicThread',
67
+ 'GuildPrivateThread',
68
+ ]))
69
+ .or(z.null())
70
+ .default(null),
32
71
  ignore: z
33
72
  .object({
34
73
  owner: z.boolean().default(false),
35
74
  users: z.array(z.string()).default([]),
36
75
  channels: z.array(z.string()).default([]),
37
76
  guilds: z.array(z.string()).default([]),
77
+ voice: z.boolean().default(false),
38
78
  })
39
79
  .default({}),
40
80
  strict: z
@@ -43,6 +83,7 @@ export default class XernerxSlashCommand {
43
83
  users: z.array(z.string()).default([]),
44
84
  channels: z.array(z.string()).default([]),
45
85
  guilds: z.array(z.string()).default([]),
86
+ voice: z.boolean().default(false),
46
87
  })
47
88
  .default({}),
48
89
  permissions: z
@@ -67,6 +108,8 @@ export default class XernerxSlashCommand {
67
108
  this.info = options.info;
68
109
  this.category = options.category;
69
110
  this.cooldown = options.cooldown;
111
+ this.channel = options.channel ? (Array.isArray(options.channel) ? options.channel : [options.channel]) : null;
112
+ this.global = options.global;
70
113
  this.ignore = options.ignore;
71
114
  this.strict = options.strict;
72
115
  this.permissions = options.permissions;
@@ -131,4 +174,3 @@ export default class XernerxSlashCommand {
131
174
  }
132
175
  }
133
176
  }
134
- //# sourceMappingURL=XernerxSlashCommand.js.map
@@ -22,9 +22,10 @@ export default class XernerxClient<T = unknown> extends Client {
22
22
  channels: string[];
23
23
  guilds: string[];
24
24
  } | undefined;
25
- log?: {
25
+ log?: boolean | {
26
26
  ready: boolean;
27
27
  error: boolean;
28
+ warn: boolean;
28
29
  info: boolean;
29
30
  table: string[] | null;
30
31
  } | undefined;
@@ -44,4 +45,3 @@ export default class XernerxClient<T = unknown> extends Client {
44
45
  constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: T);
45
46
  connect(token: string): Promise<string>;
46
47
  }
47
- //# sourceMappingURL=XernerxClient.d.ts.map
@@ -39,9 +39,11 @@ export default class XernerxClient extends Client {
39
39
  .object({
40
40
  ready: z.boolean().default(false),
41
41
  info: z.boolean().default(false),
42
+ warn: z.boolean().default(false),
42
43
  error: z.boolean().default(false),
43
44
  table: z.array(z.string()).or(z.null()).default(null),
44
45
  })
46
+ .or(z.boolean())
45
47
  .optional(),
46
48
  cooldown: z
47
49
  .object({
@@ -87,4 +89,3 @@ export default class XernerxClient extends Client {
87
89
  return login;
88
90
  }
89
91
  }
90
- //# sourceMappingURL=XernerxClient.js.map
@@ -17,4 +17,3 @@ export default class XernerxShardClient extends ShardingManager {
17
17
  constructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions);
18
18
  }
19
19
  export {};
20
- //# sourceMappingURL=XernerxShardClient.d.ts.map
@@ -43,4 +43,3 @@ export default class XernerxShardClient extends ShardingManager {
43
43
  return this;
44
44
  }
45
45
  }
46
- //# sourceMappingURL=XernerxShardClient.js.map
@@ -1,4 +1,3 @@
1
1
  /** @format */
2
2
  import XernerxClient from '../client/XernerxClient.js';
3
3
  export default function deploy(client: XernerxClient): void;
4
- //# sourceMappingURL=deploy.d.ts.map
@@ -3,30 +3,35 @@ import { GatewayVersion, REST, Routes } from 'discord.js';
3
3
  import XernerxLog from '../tools/XernerxLog.js';
4
4
  import XernerxError from '../tools/XernerxError.js';
5
5
  import { Style } from 'dumfunctions';
6
- const commands = [];
6
+ const globalCommands = [];
7
+ const localCommands = [];
7
8
  export default function deploy(client) {
9
+ const commands = [];
8
10
  client.prependOnceListener('ready', (client) => {
11
+ client.commands.slash.map((command) => commands.push(command));
12
+ client.commands.context.map((command) => commands.push(command));
13
+ client.commands.slash.map((command) => commands.push(command));
9
14
  if (client.commands.slash.size)
10
- client.commands.slash.map((command) => commands.push(command.data.toJSON()));
15
+ client.commands.slash.map((command) => (command.global ? globalCommands.push(command.data.toJSON()) : localCommands.push(command.data.toJSON())));
11
16
  if (client.commands.context.size)
12
- client.commands.context.map((command) => commands.push(command.data.toJSON()));
13
- if (commands.length <= 0)
17
+ client.commands.context.map((command) => (command.global ? globalCommands.push(command.data.toJSON()) : localCommands.push(command.data.toJSON())));
18
+ if (globalCommands.length <= 0 && localCommands.length <= 0)
14
19
  return;
15
20
  try {
16
21
  if (client.settings.global) {
17
- put(client, client.settings.global, commands);
18
- put(client, !client.settings.global, []);
22
+ put(client, client.settings.global, globalCommands);
23
+ put(client, !client.settings.global, localCommands);
19
24
  }
20
25
  else {
21
- put(client, !client.settings.global, commands);
26
+ put(client, !client.settings.global, [...globalCommands, ...localCommands]);
22
27
  put(client, client.settings.global, []);
23
28
  }
24
29
  }
25
30
  catch (error) {
26
- new XernerxLog(client).error(`An error occurred while deploying the interaction commands!`, error);
31
+ new XernerxLog(client).error(`An error occurred while deploying the commands!`, error);
27
32
  }
28
33
  finally {
29
- new XernerxLog(client).info(`Deployed ${Style.log(String([client.commands.message.size, client.commands.slash.size, client.commands.context.size].reduce((a, b) => (a += b))), {
34
+ new XernerxLog(client).info(`Deployed ${Style.log(String(commands.filter((command) => command.global).length), {
30
35
  color: Style.TextColor.Cyan,
31
36
  })} Commands ${client.settings.global
32
37
  ? Style.log('globally', { color: Style.TextColor.Green })
@@ -43,4 +48,3 @@ function put(client, global, body) {
43
48
  else
44
49
  rest.put(Routes.applicationCommands(client.user?.id), { body });
45
50
  }
46
- //# sourceMappingURL=deploy.js.map
@@ -2,4 +2,3 @@
2
2
  import XernerxClient from '../client/XernerxClient.js';
3
3
  import { filetype } from '../types/types.js';
4
4
  export default function load(client: XernerxClient, path: string, type: filetype): Promise<any>;
5
- //# sourceMappingURL=load.d.ts.map
@@ -32,4 +32,3 @@ function fileSave(client, file, type) {
32
32
  break;
33
33
  }
34
34
  }
35
- //# sourceMappingURL=load.js.map
@@ -1,4 +1,3 @@
1
1
  /** @format */
2
2
  import XernerxClient from '../client/XernerxClient.js';
3
3
  export default function reload(client: XernerxClient, type: 'message' | 'slash' | 'context' | 'event' | 'inhibitor'): Promise<any>[];
4
- //# sourceMappingURL=reload.d.ts.map
@@ -41,4 +41,3 @@ export default function reload(client, type) {
41
41
  return filedata;
42
42
  });
43
43
  }
44
- //# sourceMappingURL=reload.js.map
@@ -1,4 +1,3 @@
1
1
  /** @format */
2
2
  import { MessagePayload } from 'discord.js';
3
3
  export default function sendWebhook(url: URL, body: MessagePayload): Promise<any>;
4
- //# sourceMappingURL=sendWebhook.d.ts.map
@@ -12,4 +12,3 @@ export default async function sendWebhook(url, body) {
12
12
  const data = await response.json();
13
13
  return data;
14
14
  }
15
- //# sourceMappingURL=sendWebhook.js.map
@@ -2,4 +2,3 @@
2
2
  import XernerxClient from '../main.js';
3
3
  import { PresenceOptions } from '../types/interfaces.js';
4
4
  export default function setPresence(client: XernerxClient, options: PresenceOptions): import("discord.js").ClientPresence | undefined;
5
- //# sourceMappingURL=setPresence.d.ts.map
@@ -17,4 +17,3 @@ export default function setPresence(client, options) {
17
17
  }, options.interval);
18
18
  return response;
19
19
  }
20
- //# sourceMappingURL=setPresence.js.map
@@ -2,4 +2,3 @@
2
2
  import XernerxClient from '../client/XernerxClient.js';
3
3
  import { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
4
4
  export declare function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient): Promise<XernerxUser>;
5
- //# sourceMappingURL=xernerxUser.d.ts.map
@@ -8,4 +8,3 @@ export async function xernerxUser(event, client) {
8
8
  function isOwner(client, user) {
9
9
  return client.settings.ownerId.includes(user.id);
10
10
  }
11
- //# sourceMappingURL=xernerxUser.js.map
@@ -4,12 +4,12 @@ import { ContextHandlerOptions, MessageHandlerOptions, SlashHandlerOptions } fro
4
4
  import Handler from './Handler.js';
5
5
  export default class CommandHandler extends Handler {
6
6
  constructor(client: XernerxClient);
7
- loadMessageCommands(options: MessageHandlerOptions): void;
7
+ loadMessageCommands(options: MessageHandlerOptions): Promise<void>;
8
8
  loadSlashCommands(options: SlashHandlerOptions): void;
9
9
  loadContextCommands(options: ContextHandlerOptions): void;
10
10
  private messageCommandRun;
11
11
  private slashCommandRun;
12
12
  private contextCommandRun;
13
13
  private exec;
14
+ private _checks;
14
15
  }
15
- //# sourceMappingURL=CommandHandler.d.ts.map
@@ -15,7 +15,7 @@ export default class CommandHandler extends Handler {
15
15
  constructor(client) {
16
16
  super(client);
17
17
  }
18
- loadMessageCommands(options) {
18
+ async loadMessageCommands(options) {
19
19
  if (!this.client.options.intents.has(GatewayIntentBits.MessageContent))
20
20
  new XernerxLog(this.client).warn(`Message commands might not work as you're missing the intent MessageContent!`);
21
21
  if (!this.client.options.intents.has(GatewayIntentBits.GuildMessages))
@@ -43,7 +43,8 @@ export default class CommandHandler extends Handler {
43
43
  const files = this.readdir(options.directory);
44
44
  for (const file of files) {
45
45
  const filepath = `${path.resolve(options.directory)}\\${file}`;
46
- this.load(filepath, 'MessageCommand');
46
+ const command = await this.load(filepath, 'MessageCommand');
47
+ this._checks(command);
47
48
  }
48
49
  new XernerxLog(this.client).info(`Loaded ${Style.log(String(files.length), { color: Style.TextColor.Cyan })} Message Commands.`);
49
50
  this.emit({
@@ -288,5 +289,12 @@ export default class CommandHandler extends Handler {
288
289
  return await this.client.emit('commandError', event, error, cmd, type);
289
290
  }
290
291
  }
292
+ _checks(command) {
293
+ if ((command.strict?.voice || command.ignore?.voice) && !this.client.options.intents.has('GuildVoiceStates'))
294
+ new XernerxLog(this.client).warn(`${Style.log(command.id, { color: Style.TextColor.Blue })} options ${Style.log(`Xernerx${command.filetype}#strict#voice`, {
295
+ color: Style.BackgroundColor.Grey,
296
+ })} or ${Style.log(`Xernerx${command.filetype}#ignore#voice`, {
297
+ color: Style.BackgroundColor.Grey,
298
+ })} will misbehave due to missing the ${Style.log('GuildVoiceStates', { color: Style.TextColor.Yellow })} intent.`);
299
+ }
291
300
  }
292
- //# sourceMappingURL=CommandHandler.js.map
@@ -6,4 +6,3 @@ export default class EventHandler extends Handler {
6
6
  constructor(client: XernerxClient);
7
7
  loadEvents(options: EventHandlerOptions): Promise<void>;
8
8
  }
9
- //# sourceMappingURL=EventHandler.d.ts.map
@@ -24,4 +24,3 @@ export default class EventHandler extends Handler {
24
24
  new XernerxLog(this.client).info(`Loaded ${Style.log(String(this.client.events.size), { color: Style.TextColor.Cyan })} Events.`);
25
25
  }
26
26
  }
27
- //# sourceMappingURL=EventHandler.js.map
@@ -6,4 +6,3 @@ export default class ExtensionHandler extends Handler {
6
6
  constructor(client: XernerxClient);
7
7
  loadExtensions(...extensions: Array<XernerxExtensionBuilder>): void;
8
8
  }
9
- //# sourceMappingURL=ExtensionHandler.d.ts.map
@@ -23,4 +23,3 @@ export default class ExtensionHandler extends Handler {
23
23
  new XernerxLog(this.client).info(`Loaded ${Style.log(String(extensions.length), { color: Style.TextColor.Cyan })} Extensions: ${active.filter((e) => e).join(', ')}`);
24
24
  }
25
25
  }
26
- //# sourceMappingURL=ExtensionHandler.js.map
@@ -13,4 +13,3 @@ export default class Handler {
13
13
  load(filepath: string, type: filetype): Promise<any>;
14
14
  emit<T extends Record<string, string | boolean | Function | void>>(event: T): Promise<void>;
15
15
  }
16
- //# sourceMappingURL=Handler.d.ts.map
@@ -45,4 +45,3 @@ export default class Handler {
45
45
  }
46
46
  }
47
47
  }
48
- //# sourceMappingURL=Handler.js.map
@@ -6,4 +6,3 @@ export default class InhibitorHandler extends Handler {
6
6
  constructor(client: XernerxClient);
7
7
  loadInhibitors(options: InhibitorHandlerOptions): Promise<void>;
8
8
  }
9
- //# sourceMappingURL=InhibitorHandler.d.ts.map
@@ -24,4 +24,3 @@ export default class InhibitorHandler extends Handler {
24
24
  new XernerxLog(this.client).info(`Loaded ${Style.log(String(this.client.inhibitors.size), { color: Style.TextColor.Cyan })} Inhibitors.`);
25
25
  }
26
26
  }
27
- //# sourceMappingURL=InhibitorHandler.js.map
@@ -8,4 +8,3 @@ export default class WebhookHandler extends Handler {
8
8
  }): Promise<void>;
9
9
  private post;
10
10
  }
11
- //# sourceMappingURL=WebhookHandler.d.ts.map
@@ -46,4 +46,3 @@ export default class WebhookHandler extends Handler {
46
46
  }
47
47
  }
48
48
  }
49
- //# sourceMappingURL=WebhookHandler.js.map
package/dist/main.d.ts CHANGED
@@ -15,6 +15,10 @@ export * from './types/types.js';
15
15
  export * from './types/extenders.js';
16
16
  export * from './types/interfaces.js';
17
17
  import Discord from 'discord.js';
18
+ declare const XernerxIntents: {
19
+ Default: string[];
20
+ All: string[];
21
+ };
18
22
  export default XernerxClient;
19
23
  export {
20
24
  /**
@@ -36,5 +40,4 @@ version,
36
40
  /**
37
41
  ** Tools
38
42
  */
39
- XernerxLog, };
40
- //# sourceMappingURL=main.d.ts.map
43
+ XernerxLog, XernerxIntents, };