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.
- package/dist/build/XernerxContextCommand.d.ts +4 -1
- package/dist/build/XernerxContextCommand.js +44 -1
- package/dist/build/XernerxEvent.d.ts +0 -1
- package/dist/build/XernerxEvent.js +0 -1
- package/dist/build/XernerxInhibitor.d.ts +0 -1
- package/dist/build/XernerxInhibitor.js +0 -1
- package/dist/build/XernerxMessageCommand.d.ts +4 -1
- package/dist/build/XernerxMessageCommand.js +44 -1
- package/dist/build/XernerxSlashCommand.d.ts +4 -1
- package/dist/build/XernerxSlashCommand.js +44 -2
- package/dist/client/XernerxClient.d.ts +2 -2
- package/dist/client/XernerxClient.js +2 -1
- package/dist/client/XernerxShardClient.d.ts +0 -1
- package/dist/client/XernerxShardClient.js +0 -1
- package/dist/functions/deploy.d.ts +0 -1
- package/dist/functions/deploy.js +14 -10
- package/dist/functions/load.d.ts +0 -1
- package/dist/functions/load.js +0 -1
- package/dist/functions/reload.d.ts +0 -1
- package/dist/functions/reload.js +0 -1
- package/dist/functions/sendWebhook.d.ts +0 -1
- package/dist/functions/sendWebhook.js +0 -1
- package/dist/functions/setPresence.d.ts +0 -1
- package/dist/functions/setPresence.js +0 -1
- package/dist/functions/xernerxUser.d.ts +0 -1
- package/dist/functions/xernerxUser.js +0 -1
- package/dist/handlers/CommandHandler.d.ts +2 -2
- package/dist/handlers/CommandHandler.js +11 -3
- package/dist/handlers/EventHandler.d.ts +0 -1
- package/dist/handlers/EventHandler.js +0 -1
- package/dist/handlers/ExtensionHandler.d.ts +0 -1
- package/dist/handlers/ExtensionHandler.js +0 -1
- package/dist/handlers/Handler.d.ts +0 -1
- package/dist/handlers/Handler.js +0 -1
- package/dist/handlers/InhibitorHandler.d.ts +0 -1
- package/dist/handlers/InhibitorHandler.js +0 -1
- package/dist/handlers/WebhookHandler.d.ts +0 -1
- package/dist/handlers/WebhookHandler.js +0 -1
- package/dist/main.d.ts +5 -2
- package/dist/main.js +24 -2
- package/dist/models/Arguments.d.ts +0 -1
- package/dist/models/Arguments.js +0 -1
- package/dist/tools/XernerxError.d.ts +0 -1
- package/dist/tools/XernerxError.js +0 -1
- package/dist/tools/XernerxLog.d.ts +1 -1
- package/dist/tools/XernerxLog.js +6 -4
- package/dist/tools/XernerxText.d.ts +0 -1
- package/dist/tools/XernerxText.js +0 -1
- package/dist/types/extenders.d.ts +0 -1
- package/dist/types/extenders.js +0 -1
- package/dist/types/interfaces.d.ts +5 -1
- package/dist/types/interfaces.js +0 -1
- package/dist/types/types.d.ts +0 -1
- package/dist/types/types.js +0 -1
- package/dist/utils/ClientUtil.d.ts +0 -1
- package/dist/utils/ClientUtil.js +0 -1
- package/dist/utils/InteractionUtil.d.ts +0 -1
- package/dist/utils/InteractionUtil.js +0 -1
- package/dist/utils/MessageUtil.d.ts +2 -3
- package/dist/utils/MessageUtil.js +0 -1
- package/dist/utils/Util.d.ts +0 -1
- package/dist/utils/Util.js +0 -1
- package/dist/validators/commandValidation.d.ts +0 -1
- package/dist/validators/commandValidation.js +10 -1
- package/dist/validators/inhibitorValidations.d.ts +0 -1
- package/dist/validators/inhibitorValidations.js +0 -1
- package/package.json +4 -4
- package/dist/build/XernerxContextCommand.d.ts.map +0 -1
- package/dist/build/XernerxContextCommand.js.map +0 -1
- package/dist/build/XernerxEvent.d.ts.map +0 -1
- package/dist/build/XernerxEvent.js.map +0 -1
- package/dist/build/XernerxInhibitor.d.ts.map +0 -1
- package/dist/build/XernerxInhibitor.js.map +0 -1
- package/dist/build/XernerxMessageCommand.d.ts.map +0 -1
- package/dist/build/XernerxMessageCommand.js.map +0 -1
- package/dist/build/XernerxSlashCommand.d.ts.map +0 -1
- package/dist/build/XernerxSlashCommand.js.map +0 -1
- package/dist/client/XernerxClient.d.ts.map +0 -1
- package/dist/client/XernerxClient.js.map +0 -1
- package/dist/client/XernerxShardClient.d.ts.map +0 -1
- package/dist/client/XernerxShardClient.js.map +0 -1
- package/dist/functions/deploy.d.ts.map +0 -1
- package/dist/functions/deploy.js.map +0 -1
- package/dist/functions/load.d.ts.map +0 -1
- package/dist/functions/load.js.map +0 -1
- package/dist/functions/reload.d.ts.map +0 -1
- package/dist/functions/reload.js.map +0 -1
- package/dist/functions/sendWebhook.d.ts.map +0 -1
- package/dist/functions/sendWebhook.js.map +0 -1
- package/dist/functions/setPresence.d.ts.map +0 -1
- package/dist/functions/setPresence.js.map +0 -1
- package/dist/functions/xernerxUser.d.ts.map +0 -1
- package/dist/functions/xernerxUser.js.map +0 -1
- package/dist/handlers/CommandHandler.d.ts.map +0 -1
- package/dist/handlers/CommandHandler.js.map +0 -1
- package/dist/handlers/EventHandler.d.ts.map +0 -1
- package/dist/handlers/EventHandler.js.map +0 -1
- package/dist/handlers/ExtensionHandler.d.ts.map +0 -1
- package/dist/handlers/ExtensionHandler.js.map +0 -1
- package/dist/handlers/Handler.d.ts.map +0 -1
- package/dist/handlers/Handler.js.map +0 -1
- package/dist/handlers/InhibitorHandler.d.ts.map +0 -1
- package/dist/handlers/InhibitorHandler.js.map +0 -1
- package/dist/handlers/WebhookHandler.d.ts.map +0 -1
- package/dist/handlers/WebhookHandler.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/models/Arguments.d.ts.map +0 -1
- package/dist/models/Arguments.js.map +0 -1
- package/dist/tools/XernerxError.d.ts.map +0 -1
- package/dist/tools/XernerxError.js.map +0 -1
- package/dist/tools/XernerxLog.d.ts.map +0 -1
- package/dist/tools/XernerxLog.js.map +0 -1
- package/dist/tools/XernerxText.d.ts.map +0 -1
- package/dist/tools/XernerxText.js.map +0 -1
- package/dist/types/extenders.d.ts.map +0 -1
- package/dist/types/extenders.js.map +0 -1
- package/dist/types/interfaces.d.ts.map +0 -1
- package/dist/types/interfaces.js.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js.map +0 -1
- package/dist/utils/ClientUtil.d.ts.map +0 -1
- package/dist/utils/ClientUtil.js.map +0 -1
- package/dist/utils/InteractionUtil.d.ts.map +0 -1
- package/dist/utils/InteractionUtil.js.map +0 -1
- package/dist/utils/MessageUtil.d.ts.map +0 -1
- package/dist/utils/MessageUtil.js.map +0 -1
- package/dist/utils/Util.d.ts.map +0 -1
- package/dist/utils/Util.js.map +0 -1
- package/dist/validators/commandValidation.d.ts.map +0 -1
- package/dist/validators/commandValidation.js.map +0 -1
- package/dist/validators/inhibitorValidations.d.ts.map +0 -1
- 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 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
|
|
@@ -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
|
-
|
|
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
|
package/dist/functions/deploy.js
CHANGED
|
@@ -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
|
|
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) =>
|
|
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) =>
|
|
13
|
-
if (
|
|
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,
|
|
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,
|
|
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
|
|
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(
|
|
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
|
package/dist/functions/load.d.ts
CHANGED
package/dist/functions/load.js
CHANGED
package/dist/functions/reload.js
CHANGED
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
package/dist/handlers/Handler.js
CHANGED
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, };
|